From: Jason Dillaman Date: Fri, 24 Apr 2015 04:20:00 +0000 (-0400) Subject: librbd: librados completions are not properly released X-Git-Tag: v9.0.1~47^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea5107c3fe4b96a799bfff5d4b0f685712ca3047;p=ceph.git librbd: librados completions are not properly released Changes associated with rebuilding the object map can result in the leaking of librados AioCompletions. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/ObjectMap.cc b/src/librbd/ObjectMap.cc index e75e2b2e956..1c67c8a49ed 100644 --- a/src/librbd/ObjectMap.cc +++ b/src/librbd/ObjectMap.cc @@ -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, diff --git a/src/librbd/RebuildObjectMapRequest.cc b/src/librbd/RebuildObjectMapRequest.cc index 052600aa43b..4d9df00fa07 100644 --- a/src/librbd/RebuildObjectMapRequest.cc +++ b/src/librbd/RebuildObjectMapRequest.cc @@ -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,