]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.46/nfsv4.0-always-send-mode-in-setattr-after-exclusive4.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.4.46 / nfsv4.0-always-send-mode-in-setattr-after-exclusive4.patch
1 From a430607b2ef7c3be090f88c71cfcb1b3988aa7c0 Mon Sep 17 00:00:00 2001
2 From: Benjamin Coddington <bcodding@redhat.com>
3 Date: Tue, 24 Jan 2017 11:34:20 -0500
4 Subject: NFSv4.0: always send mode in SETATTR after EXCLUSIVE4
5
6 From: Benjamin Coddington <bcodding@redhat.com>
7
8 commit a430607b2ef7c3be090f88c71cfcb1b3988aa7c0 upstream.
9
10 Some nfsv4.0 servers may return a mode for the verifier following an open
11 with EXCLUSIVE4 createmode, but this does not mean the client should skip
12 setting the mode in the following SETATTR. It should only do that for
13 EXCLUSIVE4_1 or UNGAURDED createmode.
14
15 Fixes: 5334c5bdac92 ("NFS: Send attributes in OPEN request for NFS4_CREATE_EXCLUSIVE4_1")
16 Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
17 Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 fs/nfs/nfs4proc.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24 --- a/fs/nfs/nfs4proc.c
25 +++ b/fs/nfs/nfs4proc.c
26 @@ -2422,7 +2422,8 @@ static inline void nfs4_exclusive_attrse
27 sattr->ia_valid |= ATTR_MTIME;
28
29 /* Except MODE, it seems harmless of setting twice. */
30 - if ((attrset[1] & FATTR4_WORD1_MODE))
31 + if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE &&
32 + attrset[1] & FATTR4_WORD1_MODE)
33 sattr->ia_valid &= ~ATTR_MODE;
34
35 if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL)