summaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust2018-03-20 21:53:31 +0100
committerAnna Schumaker2018-04-10 22:06:22 +0200
commit16e143751727471f9a565515344196693bbc8762 (patch)
treeeb6905af5fe0ad1f65b2392656f0bd218a8f5a03 /fs/nfs/write.c
parentNFS: Don't force unnecessary cache invalidation in nfs_update_inode() (diff)
downloadkernel-qcow2-linux-16e143751727471f9a565515344196693bbc8762.tar.gz
kernel-qcow2-linux-16e143751727471f9a565515344196693bbc8762.tar.xz
kernel-qcow2-linux-16e143751727471f9a565515344196693bbc8762.zip
NFS: More fine grained attribute tracking
Currently, if the NFS_INO_INVALID_ATTR flag is set, for instance by a call to nfs_post_op_update_inode_locked(), then it will not be cleared until all the attributes have been revalidated. This means, for instance, that NFSv4 writes will always force a full attribute revalidation. Track the ctime, mtime, size and change attribute separately from the other attributes so that we can have nfs_post_op_update_inode_locked() set them correctly, and later have the cache consistency bitmask be able to clear them. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 7428a669d7a7..3efce54ef1cd 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1562,8 +1562,11 @@ static int nfs_writeback_done(struct rpc_task *task,
}
/* Deal with the suid/sgid bit corner case */
- if (nfs_should_remove_suid(inode))
- nfs_mark_for_revalidate(inode);
+ if (nfs_should_remove_suid(inode)) {
+ spin_lock(&inode->i_lock);
+ NFS_I(inode)->cache_validity |= NFS_INO_INVALID_OTHER;
+ spin_unlock(&inode->i_lock);
+ }
return 0;
}