Skip to content

Commit

Permalink
NFS: nfs41_walk_client_list(): re-lock before iterating
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Oct 2, 2012
1 parent ee314c2 commit c2ccc08
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfs/nfs4client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c2ccc08

Please sign in to comment.