Skip to content

Commit 4d8e28f

Browse files
Wu Boidryomov
authored andcommitted
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 <[email protected]> Reviewed-by: "Yan, Zheng" <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 7d8976a commit 4d8e28f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ceph/caps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3746,6 +3746,7 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
37463746
WARN_ON(1);
37473747
tsession = NULL;
37483748
target = -1;
3749+
mutex_lock(&session->s_mutex);
37493750
}
37503751
goto retry;
37513752

0 commit comments

Comments
 (0)