39 lines
1.2 KiB
Diff
39 lines
1.2 KiB
Diff
|
|
From d2d6ab79266fb8778c67b803d654eefdc94791f6 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Ming-Hung Tsai <mtsai@redhat.com>
|
||
|
|
Date: Tue, 24 Aug 2021 16:20:50 +0800
|
||
|
|
Subject: [PATCH] Check consistency of thin_ids before running a regular dump
|
||
|
|
|
||
|
|
---
|
||
|
|
thin-provisioning/metadata_dumper.cc | 8 ++++++--
|
||
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/thin-provisioning/metadata_dumper.cc b/thin-provisioning/metadata_dumper.cc
|
||
|
|
index 4feb40f..b462781 100644
|
||
|
|
--- a/thin-provisioning/metadata_dumper.cc
|
||
|
|
+++ b/thin-provisioning/metadata_dumper.cc
|
||
|
|
@@ -405,6 +405,9 @@ namespace {
|
||
|
|
if (rhs == ms.end())
|
||
|
|
continue;
|
||
|
|
|
||
|
|
+ if (lhs->second != rhs->second)
|
||
|
|
+ continue;
|
||
|
|
+
|
||
|
|
filtered.push_back(make_pair(p.first.b, p.second.b));
|
||
|
|
}
|
||
|
|
|
||
|
|
@@ -867,8 +870,9 @@ namespace {
|
||
|
|
|
||
|
|
auto tm = open_tm(bm, superblock_detail::SUPERBLOCK_LOCATION);
|
||
|
|
|
||
|
|
- if (!get_dev_ids(*tm, msb->device_details_root_) ||
|
||
|
|
- !get_map_ids(*tm, msb->data_mapping_root_))
|
||
|
|
+ auto maybe_dev_ids = get_dev_ids(*tm, msb->device_details_root_);
|
||
|
|
+ auto maybe_map_ids = get_map_ids(*tm, msb->data_mapping_root_);
|
||
|
|
+ if (!maybe_dev_ids || !maybe_map_ids || (*maybe_dev_ids) != (*maybe_map_ids))
|
||
|
|
find_better_roots_(bm, *msb);
|
||
|
|
|
||
|
|
emit_trees_(bm, *msb, e, opts);
|
||
|
|
--
|
||
|
|
2.33.0
|
||
|
|
|