From bfeb90e5fe24347648c72345881fd3d932243c98 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Mon, 9 Nov 2015 11:22:24 -0500 Subject: [PATCH] librbd: fixed deadlock while attempting to flush AIO requests In-flight AIO requests might force a flush if a snapshot was created out-of-band. The flush completion was previously invoked asynchronously, potentially via the same thread worker handling the AIO request. This resulted in the flush operation deadlocking since it can't complete. Fixes: #13726 Backport: infernalis, hammer Signed-off-by: Jason Dillaman --- src/librbd/ImageCtx.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 9090d368d4535..e0279d1182694 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -785,7 +785,7 @@ public: void ImageCtx::flush_async_operations(Context *on_finish) { Mutex::Locker l(async_ops_lock); if (async_ops.empty()) { - op_work_queue->queue(on_finish, 0); + on_finish->complete(0); return; } -- 2.39.5