aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-01-17 17:03:41 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-13 16:48:01 -0500
commit14ff66ce27e91666bf55e415104fdec9f9b18668 (patch)
tree4321ca88a7e514317924108f8e326d288fabcc68 /fs/nfs
parentc19422192bfb29a3c9ed00961f317b6f46f14923 (diff)
NFSv4.1: Handle errors correctly in nfs41_walk_client_list
commit 64590daa9e0dfb3aad89e3ab9230683b76211d5b upstream. 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. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4client.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 4cbad5d6b276..3afae9059222 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -324,9 +324,10 @@ int nfs40_walk_client_list(struct nfs_client *new,
324 prev = pos; 324 prev = pos;
325 325
326 status = nfs_wait_client_init_complete(pos); 326 status = nfs_wait_client_init_complete(pos);
327 spin_lock(&nn->nfs_client_lock);
328 if (status < 0) 327 if (status < 0)
329 continue; 328 goto out;
329 status = -NFS4ERR_STALE_CLIENTID;
330 spin_lock(&nn->nfs_client_lock);
330 } 331 }
331 if (pos->cl_cons_state != NFS_CS_READY) 332 if (pos->cl_cons_state != NFS_CS_READY)
332 continue; 333 continue;
@@ -464,7 +465,8 @@ int nfs41_walk_client_list(struct nfs_client *new,
464 } 465 }
465 spin_lock(&nn->nfs_client_lock); 466 spin_lock(&nn->nfs_client_lock);
466 if (status < 0) 467 if (status < 0)
467 continue; 468 break;
469 status = -NFS4ERR_STALE_CLIENTID;
468 } 470 }
469 if (pos->cl_cons_state != NFS_CS_READY) 471 if (pos->cl_cons_state != NFS_CS_READY)
470 continue; 472 continue;