diff options
| author | Benjamin Coddington <bcodding@redhat.com> | 2017-06-02 11:21:34 -0400 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-06-05 12:23:15 -0400 |
| commit | 501e7a4689378f8b1690089bfdd4f1e12ec22903 (patch) | |
| tree | 46df650388e7118f33780997d6d03b1599ae6b42 /fs | |
| parent | 3c2993b8c6143d8a5793746a54eba8f86f95240f (diff) | |
NFSv4.2: Don't send mode again in post-EXCLUSIVE4_1 SETATTR with umask
Now that we have umask support, we shouldn't re-send the mode in a SETATTR
following an exclusive CREATE, or we risk having the same problem fixed in
commit 5334c5bdac92 ("NFS: Send attributes in OPEN request for
NFS4_CREATE_EXCLUSIVE4_1"), which is that files with S_ISGID will have that
bit stripped away.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Fixes: dff25ddb4808 ("nfs: add support for the umask attribute")
Cc: stable@vger.kernel.org # v4.10+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/nfs/nfs4proc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index c08c46a3b8cd..4e43fd1270c4 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -2589,7 +2589,8 @@ static inline void nfs4_exclusive_attrset(struct nfs4_opendata *opendata, | |||
| 2589 | 2589 | ||
| 2590 | /* Except MODE, it seems harmless of setting twice. */ | 2590 | /* Except MODE, it seems harmless of setting twice. */ |
| 2591 | if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE && | 2591 | if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE && |
| 2592 | attrset[1] & FATTR4_WORD1_MODE) | 2592 | (attrset[1] & FATTR4_WORD1_MODE || |
| 2593 | attrset[2] & FATTR4_WORD2_MODE_UMASK)) | ||
| 2593 | sattr->ia_valid &= ~ATTR_MODE; | 2594 | sattr->ia_valid &= ~ATTR_MODE; |
| 2594 | 2595 | ||
| 2595 | if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL) | 2596 | if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL) |
