]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.46/nfs-don-t-increment-lock-sequence-id-after-nfs4err_moved.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.4.46 / nfs-don-t-increment-lock-sequence-id-after-nfs4err_moved.patch
1 From 059aa734824165507c65fd30a55ff000afd14983 Mon Sep 17 00:00:00 2001
2 From: Chuck Lever <chuck.lever@oracle.com>
3 Date: Sun, 22 Jan 2017 14:04:29 -0500
4 Subject: nfs: Don't increment lock sequence ID after NFS4ERR_MOVED
5
6 From: Chuck Lever <chuck.lever@oracle.com>
7
8 commit 059aa734824165507c65fd30a55ff000afd14983 upstream.
9
10 Xuan Qi reports that the Linux NFSv4 client failed to lock a file
11 that was migrated. The steps he observed on the wire:
12
13 1. The client sent a LOCK request to the source server
14 2. The source server replied NFS4ERR_MOVED
15 3. The client switched to the destination server
16 4. The client sent the same LOCK request to the destination
17 server with a bumped lock sequence ID
18 5. The destination server rejected the LOCK request with
19 NFS4ERR_BAD_SEQID
20
21 RFC 3530 section 8.1.5 provides a list of NFS errors which do not
22 bump a lock sequence ID.
23
24 However, RFC 3530 is now obsoleted by RFC 7530. In RFC 7530 section
25 9.1.7, this list has been updated by the addition of NFS4ERR_MOVED.
26
27 Reported-by: Xuan Qi <xuan.qi@oracle.com>
28 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
29 Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
30 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31
32 ---
33 include/linux/nfs4.h | 3 ++-
34 1 file changed, 2 insertions(+), 1 deletion(-)
35
36 --- a/include/linux/nfs4.h
37 +++ b/include/linux/nfs4.h
38 @@ -266,7 +266,7 @@ enum nfsstat4 {
39
40 static inline bool seqid_mutating_err(u32 err)
41 {
42 - /* rfc 3530 section 8.1.5: */
43 + /* See RFC 7530, section 9.1.7 */
44 switch (err) {
45 case NFS4ERR_STALE_CLIENTID:
46 case NFS4ERR_STALE_STATEID:
47 @@ -275,6 +275,7 @@ static inline bool seqid_mutating_err(u3
48 case NFS4ERR_BADXDR:
49 case NFS4ERR_RESOURCE:
50 case NFS4ERR_NOFILEHANDLE:
51 + case NFS4ERR_MOVED:
52 return false;
53 };
54 return true;