Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <trondmy@hammerspace.com>
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

authored by

Dai Ngo and committed by
Anna Schumaker
f588d72b 94f6f055

+2 -1
+2 -1
fs/nfs/nfs42proc.c
··· 81 81 if (status == 0) { 82 82 if (nfs_should_remove_suid(inode)) { 83 83 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); 85 86 spin_unlock(&inode->i_lock); 86 87 } 87 88 status = nfs_post_op_update_inode_force_wcc(inode,