Skip to content

Commit

Permalink
rbd-mirror: potential memory leak when attempting to cancel image sync
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
  • Loading branch information
Jason Dillaman committed Jul 20, 2016
1 parent d1c165d commit fc3fe93
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc
Expand Up @@ -549,12 +549,22 @@ void BootstrapRequest<I>::image_sync() {
BootstrapRequest<I>, &BootstrapRequest<I>::handle_image_sync>(
this);

m_image_sync_throttler->start_sync(*m_local_image_ctx,
m_remote_image_ctx, m_timer,
m_timer_lock,
m_local_mirror_uuid, m_journaler,
m_client_meta, m_work_queue, ctx,
m_progress_ctx);
{
Mutex::Locker locker(m_lock);
if (!m_canceled) {
m_image_sync_throttler->start_sync(*m_local_image_ctx,
m_remote_image_ctx, m_timer,
m_timer_lock,
m_local_mirror_uuid, m_journaler,
m_client_meta, m_work_queue, ctx,
m_progress_ctx);
return;
}
}

dout(10) << ": request canceled" << dendl;
m_ret_val = -ECANCELED;
close_remote_image();
}

template <typename I>
Expand Down

0 comments on commit fc3fe93

Please sign in to comment.