[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220712145303.4191493-1-Liam.Howlett@oracle.com>
Date: Tue, 12 Jul 2022 14:53:11 +0000
From: Liam Howlett <liam.howlett@...cle.com>
To: "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH Fix] test_maple_tree: Fix accounting in check_erase2_testset()
When overwriting an empty area, do not decrement the number of expected
entries.
Fixes: 51282228cdd4 (lib/test_maple_tree: add testing for maple tree)
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
lib/test_maple_tree.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c
index b028f5648857..c5fcaa2ba054 100644
--- a/lib/test_maple_tree.c
+++ b/lib/test_maple_tree.c
@@ -1486,7 +1486,8 @@ static noinline void check_erase2_testset(struct maple_tree *mt,
switch (set[i]) {
case SNULL:
if ((s_min == set[i+1]) && (s_max == set[i+2])) {
- entry_count--;
+ if (s_entry)
+ entry_count--;
} else if ((s_min != set[i+1]) && (s_max != set[i+2])) {
entry_count++;
} else if ((mas_start.node != mas_end.node) ||
--
2.35.1
Powered by blists - more mailing lists