aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBenjamin Coddington <bcodding@redhat.com>2017-01-24 11:34:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-01 02:33:09 -0500
commit5637949edb50c54b3074f76b648d7f873d8a6814 (patch)
tree402e5703366c363b07e00f929df40e80a84f5f0b /fs
parent0a7023506112ea7c634dffe08683d5d90f52eec6 (diff)
NFSv4.0: always send mode in SETATTR after EXCLUSIVE4
commit a430607b2ef7c3be090f88c71cfcb1b3988aa7c0 upstream. 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: 5334c5bdac92 ("NFS: Send attributes in OPEN request for NFS4_CREATE_EXCLUSIVE4_1") Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e475a3d13f27..78ff8b63d5f7 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2678,7 +2678,8 @@ static inline void nfs4_exclusive_attrset(struct nfs4_opendata *opendata,
2678 sattr->ia_valid |= ATTR_MTIME; 2678 sattr->ia_valid |= ATTR_MTIME;
2679 2679
2680 /* Except MODE, it seems harmless of setting twice. */ 2680 /* Except MODE, it seems harmless of setting twice. */
2681 if ((attrset[1] & FATTR4_WORD1_MODE)) 2681 if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE &&
2682 attrset[1] & FATTR4_WORD1_MODE)
2682 sattr->ia_valid &= ~ATTR_MODE; 2683 sattr->ia_valid &= ~ATTR_MODE;
2683 2684
2684 if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL) 2685 if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL)