From: Jason Dillaman Date: Thu, 28 May 2020 13:17:04 +0000 (-0400) Subject: librbd: drop exclusive-lock image dispatch lock before acquiring lock X-Git-Tag: v17.0.0~2184^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3457f0bf280231a46d87e2f0adf96ecad6c60a79;p=ceph.git librbd: drop exclusive-lock image dispatch lock before acquiring lock This avoids a potential race with the exclusive lock being acquired by another thread while the image dispatch layer attempts to acquire it. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/exclusive_lock/ImageDispatch.cc b/src/librbd/exclusive_lock/ImageDispatch.cc index dccb340a95446..ec76e25f25544 100644 --- a/src/librbd/exclusive_lock/ImageDispatch.cc +++ b/src/librbd/exclusive_lock/ImageDispatch.cc @@ -286,6 +286,7 @@ bool ImageDispatch::needs_exclusive_lock(bool read_op, uint64_t tid, ceph_assert(m_on_dispatches.empty() || retesting_lock); m_on_dispatches.push_back(on_dispatched); + locker.unlock(); *dispatch_result = io::DISPATCH_RESULT_RESTART; auto ctx = create_context_callback<