Commit a430607b authored by Benjamin Coddington's avatar Benjamin Coddington Committed by Trond Myklebust

NFSv4.0: always send mode in SETATTR after EXCLUSIVE4

Some nfsv4.0 servers may return a mode for the verifier following an open
with EXCLUSIVE4 createmode, but this does not mean the client should skip
setting the mode in the following SETATTR.  It should only do that for
EXCLUSIVE4_1 or UNGAURDED createmode.

Fixes: 5334c5bd ("NFS: Send attributes in OPEN request for NFS4_CREATE_EXCLUSIVE4_1")
Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Cc: stable@vger.kernel.org # v4.3+
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 059aa734
...@@ -2700,7 +2700,8 @@ static inline void nfs4_exclusive_attrset(struct nfs4_opendata *opendata, ...@@ -2700,7 +2700,8 @@ static inline void nfs4_exclusive_attrset(struct nfs4_opendata *opendata,
sattr->ia_valid |= ATTR_MTIME; sattr->ia_valid |= ATTR_MTIME;
/* Except MODE, it seems harmless of setting twice. */ /* Except MODE, it seems harmless of setting twice. */
if ((attrset[1] & FATTR4_WORD1_MODE)) if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE &&
attrset[1] & FATTR4_WORD1_MODE)
sattr->ia_valid &= ~ATTR_MODE; sattr->ia_valid &= ~ATTR_MODE;
if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL) if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment