From: Jason Dillaman Date: Mon, 27 Jun 2016 14:58:09 +0000 (-0400) Subject: rbd-mirror: fixed potential leaking image deletion context callback X-Git-Tag: ses5-milestone5~588^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d1cd90c220f95d23d2694b4f1fb6b2fed073ced;p=ceph.git rbd-mirror: fixed potential leaking image deletion context callback Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd_mirror/ImageDeleter.cc b/src/tools/rbd_mirror/ImageDeleter.cc index d1816b01b1fc..9cbc18987977 100644 --- a/src/tools/rbd_mirror/ImageDeleter.cc +++ b/src/tools/rbd_mirror/ImageDeleter.cc @@ -229,6 +229,9 @@ void ImageDeleter::wait_for_scheduled_deletion(const std::string& image_name, return; } + if ((*del_info)->on_delete != nullptr) { + (*del_info)->on_delete->complete(-ESTALE); + } (*del_info)->on_delete = ctx; (*del_info)->notify_on_failed_retry = notify_on_failed_retry; } diff --git a/src/tools/rbd_mirror/Replayer.cc b/src/tools/rbd_mirror/Replayer.cc index a538a3880e32..2ac6379a7bde 100644 --- a/src/tools/rbd_mirror/Replayer.cc +++ b/src/tools/rbd_mirror/Replayer.cc @@ -681,6 +681,10 @@ void Replayer::start_image_replayer(unique_ptr > &image_replayer if (image_name) { FunctionContext *ctx = new FunctionContext( [&] (int r) { + if (r == -ESTALE) { + return; + } + if (r >= 0) { image_replayer->start(); } else {