Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librbd: memory leak in MirroringWatcher::notify_image_updated #11306

Merged
merged 1 commit into from Oct 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/librbd/MirroringWatcher.cc
Expand Up @@ -61,7 +61,7 @@ int MirroringWatcher<I>::notify_image_updated(
}

template <typename I>
int MirroringWatcher<I>::notify_image_updated(
void MirroringWatcher<I>::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) {
Expand All @@ -75,12 +75,8 @@ int MirroringWatcher<I>::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 <typename I>
Expand Down
10 changes: 5 additions & 5 deletions src/librbd/MirroringWatcher.h
Expand Up @@ -29,11 +29,11 @@ class MirroringWatcher : public ObjectWatcher<ImageCtxT> {
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;
Expand Down