From: Casey Bodley Date: Thu, 11 Dec 2025 19:19:01 +0000 (-0500) Subject: osdc: remove implicit LingerOp reference between watch/unwatch X-Git-Tag: testing/wip-pdonnell-testing-20260108.183402~34^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1b0f873162d4bc357b230a78452531fdf39a6b25;p=ceph-ci.git osdc: remove implicit LingerOp reference between watch/unwatch before this change set, linger_register() returned a raw LingerOp pointer with an implicit reference for the caller. for librados, this implicit reference is only dropped when the corresponding unwatch() calls linger_cancel() after commit 94f42b648feea77bd09dc3fdb48e6db2b48c7717 introduced linger_by_cookie(), unwatch() no longer has a safe way to drop this implicit reference. to prevent LingerOp leaks when unwatch() returns ENOTCONN, we can't hold this implicit reference count until unwatch() linger_register() now returns an explicit reference to the caller as intrusive_ptr. this helps to guarantee that this reference count gets dropped before the completion of watch()/aio_watch() because linger_register() no longer acquires an implicit reference for the caller, linger_cancel() no longer drops it with info->put() Reported-by: Ilya Dryomov Signed-off-by: Casey Bodley --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index b90a7ecf50e..18d76a5cd48 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -792,7 +792,6 @@ void Objecter::linger_cancel(LingerOp *info) { unique_lock wl(rwlock); _linger_cancel(info); - info->put(); } void Objecter::_linger_cancel(LingerOp *info) @@ -855,7 +854,6 @@ auto Objecter::linger_register(const object_t& oid, linger_ops_set.insert(info); ceph_assert(linger_ops.size() == linger_ops_set.size()); - info->get(); // for the caller return info; }