From: Mykola Golub Date: Tue, 4 Oct 2016 12:54:09 +0000 (+0300) Subject: librbd: memory leak in MirroringWatcher::notify_image_updated X-Git-Tag: v11.0.1~32^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=91d7de44d9d7eadc8282a74a9df3e823bcb0a949;p=ceph.git librbd: memory leak in MirroringWatcher::notify_image_updated Signed-off-by: Mykola Golub --- diff --git a/src/librbd/MirroringWatcher.cc b/src/librbd/MirroringWatcher.cc index d142ae3593bf..ffed247cfc8e 100644 --- a/src/librbd/MirroringWatcher.cc +++ b/src/librbd/MirroringWatcher.cc @@ -61,7 +61,7 @@ int MirroringWatcher::notify_image_updated( } template -int MirroringWatcher::notify_image_updated( +void MirroringWatcher::notify_image_updated( librados::IoCtx &io_ctx, cls::rbd::MirrorImageState mirror_image_state, const std::string &image_id, const std::string &global_image_id, Context *on_finish) { @@ -75,12 +75,8 @@ int MirroringWatcher::notify_image_updated( librados::AioCompletion *comp = util::create_rados_ack_callback(on_finish); int r = io_ctx.aio_notify(RBD_MIRRORING, comp, bl, NOTIFY_TIMEOUT_MS, nullptr); - if (r < 0) { - lderr(cct) << ": error encountered sending image updated notification: " - << cpp_strerror(r) << dendl; - return r; - } - return 0; + assert(r == 0); + comp->release(); } template diff --git a/src/librbd/MirroringWatcher.h b/src/librbd/MirroringWatcher.h index 9111682a2e2f..09155c42aae5 100644 --- a/src/librbd/MirroringWatcher.h +++ b/src/librbd/MirroringWatcher.h @@ -29,11 +29,11 @@ public: cls::rbd::MirrorImageState mirror_image_state, const std::string &image_id, const std::string &global_image_id); - static int notify_image_updated(librados::IoCtx &io_ctx, - cls::rbd::MirrorImageState mirror_image_state, - const std::string &image_id, - const std::string &global_image_id, - Context *on_finish); + static void notify_image_updated(librados::IoCtx &io_ctx, + cls::rbd::MirrorImageState mirror_image_state, + const std::string &image_id, + const std::string &global_image_id, + Context *on_finish); virtual void handle_mode_updated(cls::rbd::MirrorMode mirror_mode, Context *on_ack) = 0;