]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: librados completions are not properly released
authorJason Dillaman <dillaman@redhat.com>
Fri, 24 Apr 2015 04:20:00 +0000 (00:20 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 28 Apr 2015 15:00:40 +0000 (11:00 -0400)
Changes associated with rebuilding the object map can result
in the leaking of librados AioCompletions.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ObjectMap.cc
src/librbd/RebuildObjectMapRequest.cc

index e75e2b2e9563e5c6472d4ae1f396c0da89f63673..1c67c8a49edcfdc2404fdded1857c56a44b367f7 100644 (file)
@@ -328,6 +328,7 @@ void ObjectMap::aio_save(Context *on_finish)
 
   int r = m_image_ctx.md_ctx.aio_operate(oid, comp, &op);
   assert(r == 0);
+  comp->release();
 }
 
 void ObjectMap::aio_resize(uint64_t new_size, uint8_t default_object_state,
index 052600aa43bac94c1ed0bca7700a066980d2348a..4d9df00fa072a2f369bc1c137fd6a5a9a4c51f88 100644 (file)
@@ -75,6 +75,7 @@ private:
     op.assert_exists();
     int r = m_image_ctx.data_ctx.aio_operate(m_oid, comp, &op, NULL);
     assert(r == 0);
+    comp->release();
   }
 
   bool update_object_map(bool exists) {
@@ -319,9 +320,10 @@ bool RebuildObjectMapRequest::send_update_header() {
       cls_client::set_flags(&op, m_image_ctx.snap_id, 0,
                             RBD_FLAG_OBJECT_MAP_INVALID);
 
-      int r = m_image_ctx.md_ctx.aio_operate(m_image_ctx.header_oid,
-                                             create_callback_completion(), &op);
+      librados::AioCompletion *comp = create_callback_completion();
+      int r = m_image_ctx.md_ctx.aio_operate(m_image_ctx.header_oid, comp, &op);
       assert(r == 0);
+      comp->release();
 
       RWLock::WLocker snap_locker(m_image_ctx.snap_lock);
       m_image_ctx.update_flags(m_image_ctx.snap_id, RBD_FLAG_OBJECT_MAP_INVALID,