]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librbd: QoS delayed dispatch needs to use op work queue
authorJason Dillaman <dillaman@redhat.com>
Thu, 14 May 2020 17:05:04 +0000 (13:05 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 14 May 2020 17:05:04 +0000 (13:05 -0400)
The QoS throttle will invoke its throttle complete callback within
the scope of the ImageCtx timer lock singleton. This would cause
the potential for deadlock if a future dispatch layer attempted
to acquire the same timer lock.

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

index dff10290080c5b43b108e1cd2aa11dc34e56ab75..7776355209b6a9842c8e5162b19686ea927df508 100644 (file)
@@ -281,7 +281,8 @@ void QosImageDispatch<I>::handle_throttle_ready(Tag&& tag, uint64_t flag) {
                  << "flag=" << flag << dendl;
 
   if (set_throttle_flag(tag.image_dispatch_flags, flag)) {
-    tag.on_dispatched->complete(0);
+    // timer_lock is held -- so dispatch from outside the timer thread
+    m_image_ctx->op_work_queue->queue(tag.on_dispatched, 0);
   }
 }