nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op
Subsystems (2)
Dai Ngo
reviewerPATCH v4 1/1 nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op
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.
---
v3 -> v4: add Suggested-by and Reviewed-by tag.
fs/nfs/nfs42proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfs/nfs42proc.c +2 -1
@@ -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); } status = nfs_post_op_update_inode_force_wcc(inode,
Signature · 1 line
2.9.5
Quoted 21 lines · Dai Ngo
The Linux NFS server strips the SUID and SGID from the file mode on ALLOCATE op.
Modify
_nfs42_proc_fallocateto addNFS_INO_REVAL_FORCEDto nfs_set_cache_invalid's argument to force update of the file mode suid/sgid bit.Suggested-by Trond Myklebust <[email protected]>Signed-off-by Dai Ngo <[email protected]>Reviewed-by Jeff Layton <[email protected]>---
v3 -> v4: add Suggested-by and Reviewed-by tag.fs/nfs/nfs42proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/nfs/nfs42proc.c +0
-0
fs/nfs/nfs42proc.c static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep, · line 88
Quoted 9 lines
fs/nfs/nfs42proc.c +2
-1@@ -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); } status = nfs_post_op_update_inode_force_wcc(inode,
This fixes generic/683 and generic/684 for me, when nfsd has issued a write delegation. This was posted some time ago. Is there some reason this hasn't been merged yet?