From: Jaya Prakash Date: Wed, 26 Feb 2025 14:02:59 +0000 (+0530) Subject: blk/kernel : skip AIO thread for zero-sized devices X-Git-Tag: v20.3.0~442^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=481dfb15e4675eecacae401500a8e5c555948314;p=ceph.git blk/kernel : skip AIO thread for zero-sized devices Sometimes devices can be 0-sized, where I/O is impossible. This change skips _aio_start() in open() if the device size is 0. This avoids unnecessary AIO setup. This issue was introduced in PR : https://github.com/ceph/ceph/pull/60791 Signed-off-by: Jaya Prakash --- diff --git a/src/blk/kernel/KernelDevice.cc b/src/blk/kernel/KernelDevice.cc index 41f0608355dd..c4e6168a61dd 100644 --- a/src/blk/kernel/KernelDevice.cc +++ b/src/blk/kernel/KernelDevice.cc @@ -295,9 +295,13 @@ int KernelDevice::open(const string& p) goto out_fail; } - r = _aio_start(); - if (r < 0) { - goto out_fail; + if (size > 0) { + r = _aio_start(); + if (r < 0) { + goto out_fail; + } + } else { + aio = false; } _discard_update_threads();