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>
(cherry picked from commit
cf8094942ccdba831e03e5a79451cfa5d78a135f)
(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;
+ }
}
}