summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-08-20 18:56:07 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-29 19:33:29 +0200
commit95141b15234777ad155895d1cb1e6f41eb2182ed (patch)
tree008a67af09f0cd0a99cbf120632d35d3eb1acb3e /fs
parent717766170de50784cf9b8100a105a8452e3aedd6 (diff)
NFSv4: Force a post-op attribute update when holding a delegation
commit aaae3f00d3f67f681a1f3cb7af999e976e8a24ce upstream. If the ctime or mtime or change attribute have changed because of an operation we initiated, we should make sure that we force an attribute update. However we do not want to mark the page cache for revalidation. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/inode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 73fdbae1e7f8..4afbe13321cb 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1483,6 +1483,13 @@ static int nfs_post_op_update_inode_locked(struct inode *inode, struct nfs_fattr
{
unsigned long invalid = NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
+ /*
+ * Don't revalidate the pagecache if we hold a delegation, but do
+ * force an attribute update
+ */
+ if (NFS_PROTO(inode)->have_delegation(inode, FMODE_READ))
+ invalid = NFS_INO_INVALID_ATTR|NFS_INO_REVAL_FORCED;
+
if (S_ISDIR(inode->i_mode))
invalid |= NFS_INO_INVALID_DATA;
nfs_set_cache_invalid(inode, invalid);