]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cleanup status global from rbd mirror if image removed 11142/head
authorHuan Zhang <zhanghuan@chinac.com>
Tue, 20 Sep 2016 03:35:03 +0000 (11:35 +0800)
committerHuan Zhang <zhanghuan@chinac.com>
Tue, 20 Sep 2016 03:35:03 +0000 (11:35 +0800)
Signed-off-by: Huan Zhang <zhanghuan@chinac.com>
src/cls/rbd/cls_rbd.cc

index f7bf2e33411012acfd111d186f36649402ba1f5e..3db3420cdc1042be6bdda1cc40628c3cd5a4c043 100644 (file)
@@ -3256,6 +3256,15 @@ int image_remove(cls_method_context_t hctx, const string &image_id) {
            cpp_strerror(r).c_str());
     return r;
   }
+
+  r = cls_cxx_map_remove_key(hctx,
+                             status_global_key(mirror_image.global_image_id));
+  if (r < 0 && r != -ENOENT) {
+    CLS_ERR("error removing global status for image '%s': %s", image_id.c_str(),
+           cpp_strerror(r).c_str());
+    return r;
+  }
+
   return 0;
 }