From 5f901fb13fc495ee73371f1b80fecb40c5526d50 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 14 May 2020 13:05:04 -0400 Subject: [PATCH] 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 --- src/librbd/io/QosImageDispatch.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librbd/io/QosImageDispatch.cc b/src/librbd/io/QosImageDispatch.cc index dff10290080..7776355209b 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); } } -- 2.39.5