From: Benjamin Coddington <bcodding@xxxxxxxxxxxxxxxxxx> On 2 Jun 2017, at 9:55, Benjamin Coddington wrote: > From: Benjamin Coddington <bcodding@xxxxxxxxxxxxxxxxxx> > > 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@xxxxxxxxxx> > --- > fs/nfs/nfs4proc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c > index c08c46a3b8cd..403787319446 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, > > /* Except MODE, it seems harmless of setting twice. */ > if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE && > - attrset[1] & FATTR4_WORD1_MODE) > + (attrset[1] & FATTR4_WORD1_MODE) || > + (attrset[2] & FATTR4_WORD2_MODE_UMASK)) ^^ I've definitely gotten the parens wrong here.. Here's the correction: 8<----------------------------------------------------------------------- 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@xxxxxxxxxx> --- fs/nfs/nfs4proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, /* Except MODE, it seems harmless of setting twice. */ if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE && - attrset[1] & FATTR4_WORD1_MODE) + (attrset[1] & FATTR4_WORD1_MODE || + attrset[2] & FATTR4_WORD2_MODE_UMASK)) sattr->ia_valid &= ~ATTR_MODE; if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html