加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-Check-consistency-of-thin_ids-before-running-a-regul.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
wangzhiqiang 提交于 2024-07-31 10:43 . backport bugfix patch from community
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化