summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2024-02-18 17:48:10 +0100
committerChuck Lever <chuck.lever@oracle.com>2024-03-05 16:22:33 +0100
commit7d5a352ccc4f5c625ce3ee37d7f883dad266127c (patch)
tree98456184d7854b4426a0eb7af1ba776e7ce8ae22
parentnfsd: Fix NFSv3 atomicity bugs in nfsd_setattr() (diff)
downloadlinux-7d5a352ccc4f5c625ce3ee37d7f883dad266127c.tar.xz
linux-7d5a352ccc4f5c625ce3ee37d7f883dad266127c.zip
NFSD: Document nfsd_setattr() fill-attributes behavior
Add an explanation to prevent the future removal of the fill- attribute call sites in nfsd_setattr(). Some NFSv3 client implementations don't behave correctly if wcc data is not present in an NFSv3 SETATTR reply. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
-rw-r--r--fs/nfsd/vfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index a3a4400e75be..6a4c506038e0 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -591,6 +591,13 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
dentry, ACL_TYPE_DEFAULT,
attr->na_dpacl);
out_fill_attrs:
+ /*
+ * RFC 1813 Section 3.3.2 does not mandate that an NFS server
+ * returns wcc_data for SETATTR. Some client implementations
+ * depend on receiving wcc_data, however, to sort out partial
+ * updates (eg., the client requested that size and mode be
+ * modified, but the server changed only the file mode).
+ */
fh_fill_post_attrs(fhp);
out_unlock:
inode_unlock(inode);