]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: aio_unwatch() delivers ENOTCONN to AioCompletion
authorCasey Bodley <cbodley@redhat.com>
Thu, 11 Dec 2025 16:34:00 +0000 (11:34 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 16 Dec 2025 15:55:32 +0000 (10:55 -0500)
94f42b648feea77bd09dc3fdb48e6db2b48c7717 added a new error condition to
IoCtx::aio_unwatch() that callers aren't prepared to handle. instead of
returning that error directly, report it asynchronously to the
AioCompletion

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/librados/IoCtxImpl.cc

index 410f18820acbcd9bbf771ddf4d3635dca84f80ff..4496e60e3fb2f0d89bd04ed3cc6882b0d381fc5a 100644 (file)
@@ -1786,7 +1786,12 @@ int librados::IoCtxImpl::aio_unwatch(uint64_t cookie, AioCompletionImpl *c)
   c->io = this;
   boost::intrusive_ptr linger_op = objecter->linger_by_cookie(cookie);
   if (!linger_op) {
-    return -ENOTCONN;
+    // reject invalid cookies with ENOTCONN, but deliver to the
+    // AioCompletion instead of returning directly
+    boost::asio::defer(client->finish_strand,
+        boost::asio::append(CB_AioCompleteAndSafe(c), -ENOTCONN));
+
+    return 0;
   }
   Context *oncomplete = new C_aio_linger_Complete(c, linger_op, true);