diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-01-17 17:03:41 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-01-19 09:31:59 -0500 |
commit | 64590daa9e0dfb3aad89e3ab9230683b76211d5b (patch) | |
tree | 376c49758cd4fabf70ca51a57e0a96192c931a5b /fs/nfs | |
parent | 263b4509ec4d47e0da3e753f85a39ea12d1eff24 (diff) |
NFSv4.1: Handle errors correctly in nfs41_walk_client_list
Both nfs41_walk_client_list and nfs40_walk_client_list expect the
'status' variable to be set to the value -NFS4ERR_STALE_CLIENTID
if the loop fails to find a match.
The problem is that the 'pos->cl_cons_state > NFS_CS_READY' changes
the value of 'status', and sets it either to the value '0' (which
indicates success), or to the value EINTR.
Cc: stable@vger.kernel.org # 3.7.x: 7b1f1fd1842e6: NFSv4/4.1: Fix bugs in
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4client.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index c1b7a80b6704..06e770ace073 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
@@ -498,9 +498,10 @@ int nfs40_walk_client_list(struct nfs_client *new, | |||
498 | prev = pos; | 498 | prev = pos; |
499 | 499 | ||
500 | status = nfs_wait_client_init_complete(pos); | 500 | status = nfs_wait_client_init_complete(pos); |
501 | spin_lock(&nn->nfs_client_lock); | ||
502 | if (status < 0) | 501 | if (status < 0) |
503 | continue; | 502 | goto out; |
503 | status = -NFS4ERR_STALE_CLIENTID; | ||
504 | spin_lock(&nn->nfs_client_lock); | ||
504 | } | 505 | } |
505 | if (pos->cl_cons_state != NFS_CS_READY) | 506 | if (pos->cl_cons_state != NFS_CS_READY) |
506 | continue; | 507 | continue; |
@@ -638,7 +639,8 @@ int nfs41_walk_client_list(struct nfs_client *new, | |||
638 | } | 639 | } |
639 | spin_lock(&nn->nfs_client_lock); | 640 | spin_lock(&nn->nfs_client_lock); |
640 | if (status < 0) | 641 | if (status < 0) |
641 | continue; | 642 | break; |
643 | status = -NFS4ERR_STALE_CLIENTID; | ||
642 | } | 644 | } |
643 | if (pos->cl_cons_state != NFS_CS_READY) | 645 | if (pos->cl_cons_state != NFS_CS_READY) |
644 | continue; | 646 | continue; |