From: Jason Dillaman Date: Thu, 14 May 2020 17:05:04 +0000 (-0400) Subject: librbd: QoS delayed dispatch needs to use op work queue X-Git-Tag: v16.1.0~2318^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34964%2Fhead;p=ceph.git librbd: QoS delayed dispatch needs to use op work queue 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 --- diff --git a/src/librbd/io/QosImageDispatch.cc b/src/librbd/io/QosImageDispatch.cc index dff10290080c..7776355209b6 100644 --- a/src/librbd/io/QosImageDispatch.cc +++ b/src/librbd/io/QosImageDispatch.cc @@ -281,7 +281,8 @@ void QosImageDispatch::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); } }