From: songweibin Date: Tue, 16 Jun 2020 11:57:37 +0000 (+0800) Subject: librbd: fix potential image rm failure due to parent missing X-Git-Tag: v16.1.0~1868^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=add083e5b72dd758a319561fdc5152665a9db67f;p=ceph.git librbd: fix potential image rm failure due to parent missing Signed-off-by: songweibin --- diff --git a/src/librbd/image/DetachChildRequest.cc b/src/librbd/image/DetachChildRequest.cc index d84a0edff115f..a6fcf5a538dcb 100644 --- a/src/librbd/image/DetachChildRequest.cc +++ b/src/librbd/image/DetachChildRequest.cc @@ -73,6 +73,9 @@ void DetachChildRequest::clone_v2_child_detach() { m_parent_spec.pool_id, m_parent_spec.pool_namespace, &m_parent_io_ctx); if (r < 0) { + if (r == -ENOENT) { + r = 0; + } finish(r); return; } @@ -143,7 +146,7 @@ void DetachChildRequest::handle_clone_v2_get_snapshot(int r) { } } - if (r < 0) { + if (r < 0 && r != -ENOENT) { ldout(cct, 5) << "failed to retrieve snapshot: " << cpp_strerror(r) << dendl; }