aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDai Ngo <[email protected]>2023-09-18 23:30:20 -0700
committerAnna Schumaker <[email protected]>2023-10-11 09:37:48 -0400
commitf588d72bd95f748849685412b1f0c7959ca228cf (patch)
treebf27058834dcef7139230fda6e7bc3f17d024a03
parent94f6f0550c625fab1f373bb86a6669b45e9748b3 (diff)
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. Suggested-by: Trond Myklebust <[email protected]> Signed-off-by: Dai Ngo <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Tested-by: Jeff Layton <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
-rw-r--r--fs/nfs/nfs42proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index 063e00aff87e..28704f924612 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);
}
status = nfs_post_op_update_inode_force_wcc(inode,