]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.10.30/nfsv4.1-handle-errors-correctly-in-nfs41_walk_client_list.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.30 / nfsv4.1-handle-errors-correctly-in-nfs41_walk_client_list.patch
CommitLineData
53d66ca4
GKH
1From 64590daa9e0dfb3aad89e3ab9230683b76211d5b Mon Sep 17 00:00:00 2001
2From: Trond Myklebust <trond.myklebust@primarydata.com>
3Date: Fri, 17 Jan 2014 17:03:41 -0500
4Subject: NFSv4.1: Handle errors correctly in nfs41_walk_client_list
5
6From: Trond Myklebust <trond.myklebust@primarydata.com>
7
8commit 64590daa9e0dfb3aad89e3ab9230683b76211d5b upstream.
9
10Both nfs41_walk_client_list and nfs40_walk_client_list expect the
11'status' variable to be set to the value -NFS4ERR_STALE_CLIENTID
12if the loop fails to find a match.
13The problem is that the 'pos->cl_cons_state > NFS_CS_READY' changes
14the value of 'status', and sets it either to the value '0' (which
15indicates success), or to the value EINTR.
16
17Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 fs/nfs/nfs4client.c | 8 +++++---
22 1 file changed, 5 insertions(+), 3 deletions(-)
23
24--- a/fs/nfs/nfs4client.c
25+++ b/fs/nfs/nfs4client.c
26@@ -324,9 +324,10 @@ int nfs40_walk_client_list(struct nfs_cl
27 prev = pos;
28
29 status = nfs_wait_client_init_complete(pos);
30- spin_lock(&nn->nfs_client_lock);
31 if (status < 0)
32- continue;
33+ goto out;
34+ status = -NFS4ERR_STALE_CLIENTID;
35+ spin_lock(&nn->nfs_client_lock);
36 }
37 if (pos->cl_cons_state != NFS_CS_READY)
38 continue;
39@@ -464,7 +465,8 @@ int nfs41_walk_client_list(struct nfs_cl
40 }
41 spin_lock(&nn->nfs_client_lock);
42 if (status < 0)
43- continue;
44+ break;
45+ status = -NFS4ERR_STALE_CLIENTID;
46 }
47 if (pos->cl_cons_state != NFS_CS_READY)
48 continue;