]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: drop exclusive-lock image dispatch lock before acquiring lock
authorJason Dillaman <dillaman@redhat.com>
Thu, 28 May 2020 13:17:04 +0000 (09:17 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 3 Jun 2020 13:45:24 +0000 (09:45 -0400)
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 <dillaman@redhat.com>
src/librbd/exclusive_lock/ImageDispatch.cc

index dccb340a954466d4b05db76f54ed00a20e2f28e6..ec76e25f25544afda784935e411ea8a2c072b7aa 100644 (file)
@@ -286,6 +286,7 @@ bool ImageDispatch<I>::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<