summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorWu Bo <wubo40@huawei.com>2020-04-30 14:12:49 +0800
committerIlya Dryomov <idryomov@gmail.com>2020-05-04 19:14:23 +0200
commit4d8e28ff3106b093d98bfd2eceb9b430c70a8758 (patch)
treee892c8e0b5ec7a78997cf977451f56f22527dbce /fs
parent7d8976afad18d4548ee472e526b126ab74012807 (diff)
ceph: fix double unlock in handle_cap_export()
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>
Diffstat (limited to 'fs')
-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 1a8e20ef35bf..5f3aa4d607de 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3746,6 +3746,7 @@ retry:
WARN_ON(1);
tsession = NULL;
target = -1;
+ mutex_lock(&session->s_mutex);
}
goto retry;