]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
blk/kernel : skip AIO thread for zero-sized devices 62009/head
authorJaya Prakash <jayaprakash@ibm.com>
Wed, 26 Feb 2025 14:02:59 +0000 (19:32 +0530)
committerJaya Prakash <jayaprakash@ibm.com>
Thu, 27 Feb 2025 10:33:40 +0000 (16:03 +0530)
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 <jayaprakash@ibm.com>
src/blk/kernel/KernelDevice.cc

index 41f0608355ddd15df52740194fb396ba36db5b83..c4e6168a61ddabc8f1403be1f83279d39d4355f2 100644 (file)
@@ -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();