]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: release RGWAioCompletionNotifier refs on destruction
authorCasey Bodley <cbodley@redhat.com>
Wed, 4 Jan 2017 16:36:00 +0000 (11:36 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 16 Jan 2017 18:54:09 +0000 (13:54 -0500)
Fixes: http://tracker.ceph.com/issues/18407
Fixes: http://tracker.ceph.com/issues/18414
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7a4975adba8b890e211d47662896e445a9822970)

src/rgw/rgw_coroutine.cc
src/rgw/rgw_coroutine.h

index 743399d5b511000bfbe029560ea366dde8a1018a..d975a5d050e36dc5c77c8e5e0b6fe361b9a8bf1b 100644 (file)
@@ -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();
index 208dfd627e01771b3aa1a832bbbafdb23ea94b0a..124a2d3c60eea4aa84bc1a006134252686381fcf 100644 (file)
@@ -7,6 +7,7 @@
 #endif
 
 #include <boost/asio.hpp>
+#include <boost/intrusive_ptr.hpp>
 
 #ifdef NEED_ASSERT_H
 #pragma pop_macro("_ASSERT_H")
@@ -30,7 +31,8 @@ class RGWAioCompletionNotifier;
 class RGWCompletionManager : public RefCountedObject {
   CephContext *cct;
   list<void *> complete_reqs;
-  set<RGWAioCompletionNotifier *> cns;
+  using NotifierRef = boost::intrusive_ptr<RGWAioCompletionNotifier>;
+  set<NotifierRef> cns;
 
   Mutex lock;
   Cond cond;