]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
SimpleRADOSStriper: retrieve AIO return values with get_return_value()
authorPatrick Donnelly <pdonnell@ibm.com>
Sat, 30 May 2026 16:18:46 +0000 (12:18 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Sun, 31 May 2026 21:59:56 +0000 (17:59 -0400)
Previously, the AIO wait logic mistakenly assumed wait_for_complete()
returned the operation's status code. This caused asynchronous I/O
errors to be silently ignored. This change explicitly calls
get_return_value() after the wait completes to ensure I/O failures are
correctly captured and propagated back to the caller.

Fixes: https://tracker.ceph.com/issues/77010
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/SimpleRADOSStriper.cc

index c0000a5d017b1666d768e1274e0a099c8ac43ae4..773b08c7fae14bc25b9171a3d0efdb39e4a1ba09 100644 (file)
@@ -163,7 +163,8 @@ int SimpleRADOSStriper::wait_for_aios(bool block)
     auto& aiocp = aios.front();
     int rc;
     if (block) {
-      rc = aiocp->wait_for_complete();
+      aiocp->wait_for_complete();
+      rc = aiocp->get_return_value();
     } else {
       if (aiocp->is_complete()) {
         rc = aiocp->get_return_value();
@@ -307,7 +308,8 @@ int SimpleRADOSStriper::shrink_alloc(uint64_t a)
   }
 
   for (auto& aiocp : removes) {
-    if (int rc = aiocp->wait_for_complete(); rc < 0 && rc != -ENOENT) {
+    aiocp->wait_for_complete();
+    if (int rc = aiocp->get_return_value(); rc < 0 && rc != -ENOENT) {
       d(1) << " aio_remove failed: " << cpp_strerror(rc) << dendl;
       return rc;
     }
@@ -326,7 +328,8 @@ int SimpleRADOSStriper::shrink_alloc(uint64_t a)
   }
   /* we need to wait so we don't have dangling extents */
   d(10) << " waiting for allocated update" << dendl;
-  if (int rc = aiocp->wait_for_complete(); rc < 0) {
+  aiocp->wait_for_complete();
+  if (int rc = aiocp->get_return_value(); rc < 0) {
     d(1) << " update failure: " << cpp_strerror(rc) << dendl;
     return rc;
   }
@@ -423,7 +426,8 @@ int SimpleRADOSStriper::set_metadata(uint64_t new_size, bool update_size)
     if (allocated != new_allocated) {
       /* we need to wait so we don't have dangling extents */
       d(10) << "waiting for allocated update" << dendl;
-      if (int rc = aiocp->wait_for_complete(); rc < 0) {
+      aiocp->wait_for_complete();
+      if (int rc = aiocp->get_return_value(); rc < 0) {
         d(1) << " update failure: " << cpp_strerror(rc) << dendl;
         return rc;
       }
@@ -506,7 +510,8 @@ ssize_t SimpleRADOSStriper::read(void* data, size_t len, uint64_t off)
 
   r = 0;
   for (auto& [bl, aiocp] : reads) {
-    if (int rc = aiocp->wait_for_complete(); rc < 0) {
+    aiocp->wait_for_complete();
+    if (int rc = aiocp->get_return_value(); rc < 0) {
       d(1) << " read failure: " << cpp_strerror(rc) << dendl;
       return rc;
     }