* Patch "NFS: Don't let the ctime override attribute barriers." has been added to the 4.1-stable tree
@ 2015-09-26 3:48 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-09-26 3:48 UTC (permalink / raw)
To: trond.myklebust, chuck.lever, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
NFS: Don't let the ctime override attribute barriers.
to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
nfs-don-t-let-the-ctime-override-attribute-barriers.patch
and it can be found in the queue-4.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 7c2dad99d60c86ec686b3bfdcb787c450a7ea89f Mon Sep 17 00:00:00 2001
From: Trond Myklebust <trond.myklebust@primarydata.com>
Date: Thu, 6 Aug 2015 12:06:30 -0400
Subject: NFS: Don't let the ctime override attribute barriers.
From: Trond Myklebust <trond.myklebust@primarydata.com>
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 | 8 --------
1 file changed, 8 deletions(-)
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1270,13 +1270,6 @@ static int nfs_check_inode_attributes(st
return 0;
}
-static int nfs_ctime_need_update(const struct inode *inode, const struct nfs_fattr *fattr)
-{
- if (!(fattr->valid & NFS_ATTR_FATTR_CTIME))
- return 0;
- return timespec_compare(&fattr->ctime, &inode->i_ctime) > 0;
-}
-
static atomic_long_t nfs_attr_generation_counter;
static unsigned long nfs_read_attr_generation_counter(void)
@@ -1425,7 +1418,6 @@ static int nfs_inode_attrs_need_update(c
const struct nfs_inode *nfsi = NFS_I(inode);
return ((long)fattr->gencount - (long)nfsi->attr_gencount) > 0 ||
- nfs_ctime_need_update(inode, fattr) ||
((long)nfsi->attr_gencount - (long)nfs_read_attr_generation_counter() > 0);
}
Patches currently in stable-queue which might be from trond.myklebust@primarydata.com are
queue-4.1/nfs-don-t-let-the-ctime-override-attribute-barriers.patch
queue-4.1/nfsv4-don-t-set-setattr-for-o_rdonly-o_excl.patch
queue-4.1/nfsv4.1-pnfs-fix-borken-function-_same_data_server_addrs_locked.patch
queue-4.1/nfsv4-pnfs-ensure-we-don-t-miss-a-file-extension.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-26 6:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 3:48 Patch "NFS: Don't let the ctime override attribute barriers." has been added to the 4.1-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.