]> git.hungrycats.org Git - linux/commit
NFS: Don't let the ctime override attribute barriers.
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 6 Aug 2015 16:06:30 +0000 (12:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:33:28 +0000 (19:33 +0200)
commit18ea445c33dc60bebdc55348a882b1bb172ff05a
treed60971ffce7acfc1507aed97363a9f558efd6a38
parent7d3b819ed9e5eaf26b5b259ac197e2f565334e8b
NFS: Don't let the ctime override attribute barriers.

commit 7c2dad99d60c86ec686b3bfdcb787c450a7ea89f upstream.

Chuck reports seeing cases where a GETATTR that happens to race
with an asynchronous WRITE is overriding the file size, despite
the attribute barrier being set by the writeback code.

The culprit turns out to be the check in nfs_ctime_need_update(),
which sees that the ctime is newer than the cached ctime, and
assumes that it is safe to override the attribute barrier.
This patch removes that override, and ensures that attribute
barriers are always respected.

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Fixes: a08a8cd375db9 ("NFS: Add attribute update barriers to NFS writebacks")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/inode.c