From 7a4975adba8b890e211d47662896e445a9822970 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 4 Jan 2017 11:36:00 -0500 Subject: [PATCH] rgw: release RGWAioCompletionNotifier refs on destruction Fixes: http://tracker.ceph.com/issues/18407 Fixes: http://tracker.ceph.com/issues/18414 Signed-off-by: Casey Bodley --- src/rgw/rgw_coroutine.cc | 3 --- src/rgw/rgw_coroutine.h | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index 0c403cfa9f99..9609a154dffa 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -43,7 +43,6 @@ void RGWCompletionManager::register_completion_notifier(RGWAioCompletionNotifier Mutex::Locker l(lock); if (cn) { cns.insert(cn); - cn->get(); } } @@ -52,7 +51,6 @@ void RGWCompletionManager::unregister_completion_notifier(RGWAioCompletionNotifi Mutex::Locker l(lock); if (cn) { cns.erase(cn); - cn->put(); } } @@ -60,7 +58,6 @@ void RGWCompletionManager::_complete(RGWAioCompletionNotifier *cn, void *user_in { if (cn) { cns.erase(cn); - cn->put(); } complete_reqs.push_back(user_info); cond.Signal(); diff --git a/src/rgw/rgw_coroutine.h b/src/rgw/rgw_coroutine.h index 208dfd627e01..124a2d3c60ee 100644 --- a/src/rgw/rgw_coroutine.h +++ b/src/rgw/rgw_coroutine.h @@ -7,6 +7,7 @@ #endif #include +#include #ifdef NEED_ASSERT_H #pragma pop_macro("_ASSERT_H") @@ -30,7 +31,8 @@ class RGWAioCompletionNotifier; class RGWCompletionManager : public RefCountedObject { CephContext *cct; list complete_reqs; - set cns; + using NotifierRef = boost::intrusive_ptr; + set cns; Mutex lock; Cond cond; -- 2.47.3