diff options
author | Wu Bo <wubo40@huawei.com> | 2020-04-30 09:12:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-27 18:46:34 +0300 |
commit | b68d27c5fffd287d64ecbdc570312d668373f1e7 (patch) | |
tree | ae090eb5c39fa6a495836c7224a80576a22a0d26 /fs/ceph | |
parent | df0df8ee2ac72809237b04c94cf83fddf412a2b8 (diff) | |
download | linux-b68d27c5fffd287d64ecbdc570312d668373f1e7.tar.xz |
ceph: fix double unlock in handle_cap_export()
[ Upstream commit 4d8e28ff3106b093d98bfd2eceb9b430c70a8758 ]
If the ceph_mdsc_open_export_target_session() return fails, it will
do a "goto retry", but the session mutex has already been unlocked.
Re-lock the mutex in that case to ensure that we don't unlock it
twice.
Signed-off-by: Wu Bo <wubo40@huawei.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 703945cce0e5..2d602c2b0ff6 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -3693,6 +3693,7 @@ retry: WARN_ON(1); tsession = NULL; target = -1; + mutex_lock(&session->s_mutex); } goto retry; |