From 2848244e73f1ade353c438567cd3abf8a6e967bc Mon Sep 17 00:00:00 2001 From: Jaya Prakash Date: Mon, 10 Feb 2025 16:37:59 +0530 Subject: [PATCH] blk/kernel : Make bdev stop immediately Fixes : https://tracker.ceph.com/issues/68881 Signed-off-by: Jaya Prakash --- src/blk/kernel/KernelDevice.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/blk/kernel/KernelDevice.cc b/src/blk/kernel/KernelDevice.cc index 72921e6d9f0..3d55cc0ec9b 100644 --- a/src/blk/kernel/KernelDevice.cc +++ b/src/blk/kernel/KernelDevice.cc @@ -541,7 +541,20 @@ void KernelDevice::_aio_stop() if (aio) { dout(10) << __func__ << dendl; aio_stop = true; + + IOContext wakeup_ctx(cct, nullptr, false); + bufferlist bl; + aio_read(0, block_size, &bl, &wakeup_ctx); + aio_submit(&wakeup_ctx); + aio_thread.join(); + + if (cct->_conf->bdev_debug_aio) { + for (auto& i: wakeup_ctx.running_aios) { + debug_aio_unlink(i); + } + } + aio_stop = false; io_queue->shutdown(); } -- 2.39.5