Commit 28ed91e0 authored by Benjamin Coddington's avatar Benjamin Coddington Committed by Greg Kroah-Hartman

NFS: Fix a double unlock from nfs_match,get_client

[ Upstream commit c260121a ]

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

Fixes: 950a578c ("NFS: make nfs_match_client killable")
Reported-by: syzbot+228a82b263b5da91883d@syzkaller.appspotmail.com
Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c1ad36e9
...@@ -299,9 +299,9 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat ...@@ -299,9 +299,9 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat
spin_unlock(&nn->nfs_client_lock); spin_unlock(&nn->nfs_client_lock);
error = nfs_wait_client_init_complete(clp); error = nfs_wait_client_init_complete(clp);
nfs_put_client(clp); nfs_put_client(clp);
spin_lock(&nn->nfs_client_lock);
if (error < 0) if (error < 0)
return ERR_PTR(error); return ERR_PTR(error);
spin_lock(&nn->nfs_client_lock);
goto again; goto again;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment