]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/operation/SnapshotRemoveRequest.cc
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / librbd / operation / SnapshotRemoveRequest.cc
index cc975d176350c340a3d56d94e397b7975d254495..f3b4dc62e046bfdae180866731f1742a1ccf491c 100644 (file)
@@ -355,9 +355,10 @@ void SnapshotRemoveRequest<I>::handle_remove_object_map(int r) {
 template <typename I>
 void SnapshotRemoveRequest<I>::remove_image_state() {
   I &image_ctx = this->m_image_ctx;
-  auto type = cls::rbd::get_snap_namespace_type(m_snap_namespace);
 
-  if (type != cls::rbd::SNAPSHOT_NAMESPACE_TYPE_MIRROR) {
+  const auto* info = std::get_if<cls::rbd::MirrorSnapshotNamespace>(
+    &m_snap_namespace);
+  if (info == nullptr || info->is_orphan()) {
     release_snap_id();
     return;
   }