]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ignore ENOENT error when removing image from mirror directory
authorJason Dillaman <dillaman@redhat.com>
Thu, 16 Jun 2016 13:31:03 +0000 (09:31 -0400)
committerLoic Dachary <ldachary@redhat.com>
Thu, 30 Jun 2016 07:14:40 +0000 (09:14 +0200)
Fixes: http://tracker.ceph.com/issues/16348
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 4255afd34927ad6c303074aa6814538a8b5ae96e)

src/librbd/internal.cc

index 13682df4182ab9a05d96130ea64d3fa32a740448..55036dd2958a4456b736d7d8327e1a65d92ad062 100644 (file)
@@ -395,7 +395,7 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force,
 
   if (remove) {
     r = cls_client::mirror_image_remove(&ictx->md_ctx, ictx->id);
-    if (r < 0) {
+    if (r < 0 && r != -ENOENT) {
       lderr(cct) << "failed to remove image from mirroring directory: "
                  << cpp_strerror(r) << dendl;
       return r;
@@ -1827,7 +1827,7 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force,
             }
           } else if (mirror_mode == RBD_MIRROR_MODE_POOL) {
             r = cls_client::mirror_image_remove(&ictx->md_ctx, ictx->id);
-            if (r < 0) {
+            if (r < 0 && r != -ENOENT) {
               lderr(cct) << "failed to remove image from mirroring directory: "
                          << cpp_strerror(r) << dendl;
               return r;