Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
NFS: Fix a double unlock from nfs_match,get_client
Browse files Browse the repository at this point in the history
[ Upstream commit c260121 ]

Now that nfs_match_client drops the nfs_client_lock, we should be
careful
to always return it in the same condition: locked.

Fixes: 950a578 ("NFS: make nfs_match_client killable")
Reported-by: [email protected]
Signed-off-by: Benjamin Coddington <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Benjamin Coddington authored and gregkh committed May 31, 2019
1 parent 3d5e860 commit de69696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat
spin_unlock(&nn->nfs_client_lock);
error = nfs_wait_client_init_complete(clp);
nfs_put_client(clp);
spin_lock(&nn->nfs_client_lock);
if (error < 0)
return ERR_PTR(error);
spin_lock(&nn->nfs_client_lock);
goto again;
}

Expand Down

0 comments on commit de69696

Please sign in to comment.