Merge pull request #35596 from Songweibin/wip-fix-rbd-rm

librbd: fix potential image rm failure due to parent missing

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2020-07-01 13:18:00 -04:00 committed by GitHub
commit 82e27b536a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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;
}