From: Casey Bodley Date: Thu, 11 Dec 2025 19:16:20 +0000 (-0500) Subject: neorados: Notifier holds intrusive_ptr X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9456aa73689924a0ad85005e824444b48d3c7d99;p=ceph.git neorados: Notifier holds intrusive_ptr Signed-off-by: Casey Bodley --- diff --git a/src/neorados/RADOS.cc b/src/neorados/RADOS.cc index 3824e3fe6c3d..cea79e2fb012 100644 --- a/src/neorados/RADOS.cc +++ b/src/neorados/RADOS.cc @@ -1382,7 +1382,7 @@ class Notifier : public async::service_list_base_hook { }; asio::io_context::executor_type ex; - Objecter::LingerOp* linger_op; + boost::intrusive_ptr linger_op; // Zero for unbounded. I would not recommend this. const uint32_t capacity; @@ -1397,18 +1397,17 @@ class Notifier : public async::service_list_base_hook { if (neoref) { neoref = nullptr; } - if (linger_op) { - linger_op->put(); - } + linger_op.reset(); std::unique_lock l(m); handlers.clear(); } public: - Notifier(asio::io_context::executor_type ex, Objecter::LingerOp* linger_op, + Notifier(asio::io_context::executor_type ex, + boost::intrusive_ptr linger_op, uint32_t capacity, std::shared_ptr neoref) - : ex(ex), linger_op(linger_op), capacity(capacity), + : ex(ex), linger_op(std::move(linger_op)), capacity(capacity), svc(asio::use_service>( asio::query(ex, boost::asio::execution::context))), neoref(std::move(neoref)) { @@ -1523,12 +1522,12 @@ void RADOS::watch_(Object o, IOContext _ioc, auto e = asio::prefer(get_executor(), asio::execution::outstanding_work.tracked); impl->objecter->linger_watch( - linger_op, op, ioc->snapc, ceph::real_clock::now(), bl, + linger_op.get(), op, ioc->snapc, ceph::real_clock::now(), bl, asio::bind_executor( std::move(e), [c = std::move(c), cookie, linger_op](bs::error_code e, cb::list) mutable { if (e) { - linger_op->objecter->linger_cancel(linger_op); + linger_op->objecter->linger_cancel(linger_op.get()); cookie = 0; } asio::dispatch(asio::append(std::move(c), e, cookie)); @@ -1557,13 +1556,13 @@ void RADOS::watch_(Object o, IOContext _ioc, WatchComp c, auto e = asio::prefer(get_executor(), asio::execution::outstanding_work.tracked); impl->objecter->linger_watch( - linger_op, op, ioc->snapc, ceph::real_clock::now(), bl, + linger_op.get(), op, ioc->snapc, ceph::real_clock::now(), bl, asio::bind_executor( std::move(e), [c = std::move(c), cookie, linger_op](bs::error_code e, cb::list) mutable { if (e) { linger_op->user_data.reset(); - linger_op->objecter->linger_cancel(linger_op); + linger_op->objecter->linger_cancel(linger_op.get()); cookie = 0; } asio::dispatch(asio::append(std::move(c), e, cookie));