diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2019-05-09 07:25:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-31 06:46:35 -0700 |
commit | 26433652f0e429b7a641eb32927b683819ca5eb0 (patch) | |
tree | 2a83f72b4ebf538375cf043aa395ae65d5288e7c /fs | |
parent | 1a686177acdec679c90200c0f5db04155a1c4493 (diff) | |
download | linux-rpi3-26433652f0e429b7a641eb32927b683819ca5eb0.tar.gz linux-rpi3-26433652f0e429b7a641eb32927b683819ca5eb0.tar.bz2 linux-rpi3-26433652f0e429b7a641eb32927b683819ca5eb0.zip |
NFS: Fix a double unlock from nfs_match,get_client
[ Upstream commit c260121a97a3e4df6536edbc2f26e166eff370ce ]
Now that nfs_match_client drops the nfs_client_lock, we should be
careful
to always return it in the same condition: locked.
Fixes: 950a578c6128 ("NFS: make nfs_match_client killable")
Reported-by: syzbot+228a82b263b5da91883d@syzkaller.appspotmail.com
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 846d45cb1a3c..c092661147b3 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -305,9 +305,9 @@ again: 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; } |