]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: queued IOs should retry acquiring exclusive lock
authorJason Dillaman <dillaman@redhat.com>
Mon, 31 Aug 2020 22:25:20 +0000 (18:25 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 18 Sep 2020 00:40:09 +0000 (20:40 -0400)
If the IO that attempts to acquire the exclusive lock fails,
any queued IO will not be retried leading to a deadlock.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/exclusive_lock/ImageDispatch.cc

index 6f6cf231f808dc6d5074ae0770b63928684c5d21..66dda453bf3d8516aa4586e8cd21e10b6867b97d 100644 (file)
@@ -309,11 +309,11 @@ void ImageDispatch<I>::handle_acquire_lock(int r) {
                << dendl;
     failed_dispatch = m_on_dispatches.front();
     m_on_dispatches.pop_front();
-  } else {
-    // re-test is lock is still required (i.e. it wasn't acquired) via a restart
-    // dispatch
-    std::swap(on_dispatches, m_on_dispatches);
   }
+
+  // re-test if lock is still required (i.e. it wasn't acquired/lost) via a
+  // restart dispatch
+  std::swap(on_dispatches, m_on_dispatches);
   locker.unlock();
 
   if (failed_dispatch != nullptr) {