From: Jason Dillaman Date: Mon, 16 Mar 2015 22:40:49 +0000 (-0400) Subject: librbd: snap_remove should ignore -ENOENT errors X-Git-Tag: v0.94~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4246%2Fhead;p=ceph.git librbd: snap_remove should ignore -ENOENT errors 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 (cherry picked from commit cf8094942ccdba831e03e5a79451cfa5d78a135f) --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 2651ba6208f8..c356c79fe3b5 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -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; + } } }