Skip to content

Commit f588d72

Browse files
daimngoamschuma-ntap
authored andcommitted
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]>
1 parent 94f6f05 commit f588d72

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/nfs/nfs42proc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
8181
if (status == 0) {
8282
if (nfs_should_remove_suid(inode)) {
8383
spin_lock(&inode->i_lock);
84-
nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE);
84+
nfs_set_cache_invalid(inode,
85+
NFS_INO_REVAL_FORCED | NFS_INO_INVALID_MODE);
8586
spin_unlock(&inode->i_lock);
8687
}
8788
status = nfs_post_op_update_inode_force_wcc(inode,

0 commit comments

Comments
 (0)