]>
Commit | Line | Data |
---|---|---|
53d66ca4 GKH |
1 | From 64590daa9e0dfb3aad89e3ab9230683b76211d5b Mon Sep 17 00:00:00 2001 |
2 | From: Trond Myklebust <trond.myklebust@primarydata.com> | |
3 | Date: Fri, 17 Jan 2014 17:03:41 -0500 | |
4 | Subject: NFSv4.1: Handle errors correctly in nfs41_walk_client_list | |
5 | ||
6 | From: Trond Myklebust <trond.myklebust@primarydata.com> | |
7 | ||
8 | commit 64590daa9e0dfb3aad89e3ab9230683b76211d5b upstream. | |
9 | ||
10 | Both nfs41_walk_client_list and nfs40_walk_client_list expect the | |
11 | 'status' variable to be set to the value -NFS4ERR_STALE_CLIENTID | |
12 | if the loop fails to find a match. | |
13 | The problem is that the 'pos->cl_cons_state > NFS_CS_READY' changes | |
14 | the value of 'status', and sets it either to the value '0' (which | |
15 | indicates success), or to the value EINTR. | |
16 | ||
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/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; |