From 7d5a352ccc4f5c625ce3ee37d7f883dad266127c Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Sun, 18 Feb 2024 11:48:10 -0500 Subject: 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 --- fs/nfsd/vfs.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- cgit v1.2.3