]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: fixed potential leaking image deletion context callback
authorJason Dillaman <dillaman@redhat.com>
Mon, 27 Jun 2016 14:58:09 +0000 (10:58 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 11 Aug 2016 15:28:19 +0000 (11:28 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 9d1cd90c220f95d23d2694b4f1fb6b2fed073ced)

src/tools/rbd_mirror/ImageDeleter.cc
src/tools/rbd_mirror/Replayer.cc

index d1816b01b1fcdbae98ff2eabe06b3da3a489200b..9cbc18987977f9055918eeeda1e46cff93f85cd0 100644 (file)
@@ -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;
 }
index a538a3880e3209a689fb6a299a6e6d05786de865..2ac6379a7bde766724515b70cd1ad7e0ec050c2b 100644 (file)
@@ -681,6 +681,10 @@ void Replayer::start_image_replayer(unique_ptr<ImageReplayer<> > &image_replayer
   if (image_name) {
     FunctionContext *ctx = new FunctionContext(
         [&] (int r) {
+          if (r == -ESTALE) {
+            return;
+          }
+
           if (r >= 0) {
             image_replayer->start();
           } else {