linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFS: nfs41_walk_client_list(): re-lock before iterating
@ 2012-10-02 16:18 Chuck Lever
  0 siblings, 0 replies; only message in thread
From: Chuck Lever @ 2012-10-02 16:18 UTC (permalink / raw)
  To: trond.myklebust; +Cc: fengguang.wu, linux-nfs

Sparse identified an execution path in nfs41_walk_client_list()
where the nfs_client_lock is not re-acquired before taking the next
loop iteration.

fs/nfs/nfs4client.c:437:9: sparse: context imbalance in
 'nfs41_walk_client_list' - different lock contexts for basic block

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
---

 fs/nfs/nfs4client.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 8466e60..6bacfde 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -450,6 +450,7 @@ int nfs41_walk_client_list(struct nfs_client *new,
 			error = nfs_wait_client_init_complete(pos);
 			if (error < 0) {
 				nfs_put_client(pos);
+				spin_lock(&nn->nfs_client_lock);
 				continue;
 			}
 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-02 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 16:18 [PATCH] NFS: nfs41_walk_client_list(): re-lock before iterating Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).