From 1f69e9c3b3a6a2c2d95a6c34073ba65878c50fad Mon Sep 17 00:00:00 2001 From: kouwenqi Date: Wed, 10 Apr 2024 10:47:31 +0800 Subject: [PATCH] btree: fix rebalancing checks --- 0004-btree-Fix-rebalancing-checks.patch | 25 +++++++++++++++++++++++++ thin-provisioning-tools.spec | 6 +++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 0004-btree-Fix-rebalancing-checks.patch diff --git a/0004-btree-Fix-rebalancing-checks.patch b/0004-btree-Fix-rebalancing-checks.patch new file mode 100644 index 0000000..1a73fea --- /dev/null +++ b/0004-btree-Fix-rebalancing-checks.patch @@ -0,0 +1,25 @@ +From 8bfe7ee6f3fa89482a09d3c6ea933759f4d4b4a7 Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Thu, 25 Mar 2021 15:06:52 +0800 +Subject: [PATCH] [btree] Fix rebalancing checks + +--- + persistent-data/data-structures/btree.tcc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/persistent-data/data-structures/btree.tcc b/persistent-data/data-structures/btree.tcc +index 059ebaa..27c9adc 100644 +--- a/persistent-data/data-structures/btree.tcc ++++ b/persistent-data/data-structures/btree.tcc +@@ -338,7 +338,7 @@ namespace persistent_data { + unsigned nr_right = rhs.get_nr_entries(); + unsigned max_entries = get_max_entries(); + +- if (nr_left - count > max_entries || nr_right - count > max_entries) ++ if (nr_left - count > max_entries || nr_right + count > max_entries) + throw runtime_error("too many entries"); + + if (count > 0) { +-- +2.23.0 + diff --git a/thin-provisioning-tools.spec b/thin-provisioning-tools.spec index f0f1044..8ce75b1 100644 --- a/thin-provisioning-tools.spec +++ b/thin-provisioning-tools.spec @@ -1,6 +1,6 @@ Name: thin-provisioning-tools Version: 0.9.0 -Release: 4 +Release: 5 Summary: Tools for manipulating Device-mapper metadata License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools @@ -8,6 +8,7 @@ Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version Patch1: 0001-device-mapper-persistent-data-avoid-strip.patch Patch2: 0002-build-remove-lboost_iostreams-linker-flag.patch Patch3: 0003-thin_ll_dump-Fix-potential-segfault-while-reading-in.patch +Patch4: 0004-btree-Fix-rebalancing-checks.patch BuildRequires: autoconf, expat-devel BuildRequires: libaio-devel, libstdc++-devel @@ -52,6 +53,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_mandir}/man*/* %changelog +* Wed Apr 10 2024 kouwenqi - 0.9.0-5 +- btree: fix rebalancing checks + * Fri Nov 4 2022 wuguanghao - 0.9.0-4 - backport bugfix patch from community -- Gitee