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)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 17 Aug 2015 18:37:21 +0000 (13:37 -0500)
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")
Cc: stable@vger.kernel.org # v4.0+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/inode.c

diff --cc fs/nfs/inode.c
Simple merge