From: Wu Bo Date: Thu, 30 Apr 2020 06:12:49 +0000 (+0800) Subject: ceph: fix double unlock in handle_cap_export() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4d8e28ff3106b093d98bfd2eceb9b430c70a8758;p=linux.git 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 Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 1a8e20ef35bf6..5f3aa4d607def 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;