]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
NFSD: Document nfsd_setattr() fill-attributes behavior
authorChuck Lever <chuck.lever@oracle.com>
Sun, 18 Feb 2024 16:48:10 +0000 (11:48 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 5 Mar 2024 15:22:33 +0000 (10:22 -0500)
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>
fs/nfsd/vfs.c

index a3a4400e75be1046f901a08ac1ca4258e46e3f87..6a4c506038e00d3903908adb22737a3d97a8467f 100644 (file)
@@ -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);