]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: snap_remove should ignore -ENOENT errors 4035/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 16 Mar 2015 22:40:49 +0000 (18:40 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 16 Mar 2015 22:40:49 +0000 (18:40 -0400)
If the attempt to deregister the snapshot from the parent
image fails with -ENOENT, ignore the error as it is safe
to assume that the child is not associated with the parent.

Fixes: #11113
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/internal.cc

index 399ce43036bb9eb04b6c76218f801a0b52fbee50..76fd7f9892b2ca7488b26006ae294760f84e5e9f 100644 (file)
@@ -584,8 +584,11 @@ namespace librbd {
          (scan_for_parents(ictx, our_pspec, snap_id) == -ENOENT)) {
          r = cls_client::remove_child(&ictx->md_ctx, RBD_CHILDREN,
                                       our_pspec, ictx->id);
-         if (r < 0)
+         if (r < 0 && r != -ENOENT) {
+            lderr(ictx->cct) << "snap_remove: failed to deregister from parent "
+                                "image" << dendl;
            return r;
+          }
       }
     }