Skip to content

Commit 9ff022f

Browse files
scottmayhewAnna Schumaker
authored andcommitted
NFS: check if suid/sgid was cleared after a write as needed
I noticed xfstests generic/193 and generic/355 started failing against knfsd after commit e7a8ebc ("NFSD: Offer write delegation for OPEN with OPEN4_SHARE_ACCESS_WRITE"). I ran those same tests against ONTAP (which has had write delegation support for a lot longer than knfsd) and they fail there too... so while it's a new failure against knfsd, it isn't an entirely new failure. Add the NFS_INO_REVAL_FORCED flag so that the presence of a delegation doesn't keep the inode from being revalidated to fetch the updated mode. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
1 parent 7a84394 commit 9ff022f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/nfs/write.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,8 @@ static int nfs_writeback_done(struct rpc_task *task,
15351535
/* Deal with the suid/sgid bit corner case */
15361536
if (nfs_should_remove_suid(inode)) {
15371537
spin_lock(&inode->i_lock);
1538-
nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE);
1538+
nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE
1539+
| NFS_INO_REVAL_FORCED);
15391540
spin_unlock(&inode->i_lock);
15401541
}
15411542
return 0;

0 commit comments

Comments
 (0)