diff mbox series

[v3,1/1] nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op

Message ID 036ba970-a302-097a-1155-881f4ec3f8b8@oracle.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/1] nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op | expand

Commit Message

Dai Ngo Sept. 18, 2023, 6:49 p.m. UTC
Hi Anna,

Was this patch rejected? The fix was suggested by Trond.
I should have the 'Suggested-by: Trond Myklebust<trondmy@hammerspace.com>' tag.

Thanks,
-Dai



-------- Forwarded Message --------
Subject: 	[PATCH v3 1/1] nfs42: client needs to strip file mode's 
suid/sgid bit after ALLOCATE op
Date: 	Thu, 24 Aug 2023 16:11:47 -0700
From: 	Dai Ngo <dai.ngo@oracle.com>
To: 	trondmy@hammerspace.com, anna@kernel.org
CC: 	linux-nfs@vger.kernel.org



The Linux NFS server strips the SUID and SGID from the file mode
on ALLOCATE op.

Modify _nfs42_proc_fallocate to add NFS_INO_REVAL_FORCED to
nfs_set_cache_invalid's argument to force update of the
file mode suid/sgid bit.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
---
fs/nfs/nfs42proc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

status = nfs_post_op_update_inode_force_wcc(inode,
diff mbox series

Patch

diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index 63802d195556..9d2f07feeb29 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -81,7 +81,8 @@  static int _nfs42_proc_fallocate(struct rpc_message 
*msg, struct file *filep,
if (status == 0) {
if (nfs_should_remove_suid(inode)) {
spin_lock(&inode->i_lock);
- nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE);
+ nfs_set_cache_invalid(inode,
+ NFS_INO_REVAL_FORCED | NFS_INO_INVALID_MODE);
spin_unlock(&inode->i_lock);
}