summaryrefslogtreecommitdiff
path: root/fs/ceph
diff options
context:
space:
mode:
authorWu Bo <wubo40@huawei.com>2020-04-30 14:12:49 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-27 16:43:01 +0200
commit2a41dc82b599d5e7db674c8acb404d7bf8abaf2f (patch)
tree6070ac5fac99588bd59f285e19a602119c64734f /fs/ceph
parent453a376476ef8c25ab2bbc24370c39cfac8da05a (diff)
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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 1b5a50848b5b..589cfe3ed873 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3502,6 +3502,7 @@ retry:
WARN_ON(1);
tsession = NULL;
target = -1;
+ mutex_lock(&session->s_mutex);
}
goto retry;