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 <dillaman@redhat.com>
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;
}