]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix potential image rm failure due to parent missing 35596/head
authorsongweibin <song.weibin@zte.com.cn>
Tue, 16 Jun 2020 11:57:37 +0000 (19:57 +0800)
committersongweibin <song.weibin@zte.com.cn>
Thu, 18 Jun 2020 11:15:14 +0000 (19:15 +0800)
Signed-off-by: songweibin <song.weibin@zte.com.cn>
src/librbd/image/DetachChildRequest.cc

index d84a0edff115fc7fae4675b6774e73b7bbe3b4c5..a6fcf5a538dcb919cbe5ba667b268520e25cc1d7 100644 (file)
@@ -73,6 +73,9 @@ void DetachChildRequest<I>::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<I>::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;
   }