linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH Fix] test_maple_tree: Fix accounting in check_erase2_testset()
@ 2022-07-12 14:53 Liam Howlett
  0 siblings, 0 replies; only message in thread
From: Liam Howlett @ 2022-07-12 14:53 UTC (permalink / raw)
  To: maple-tree, linux-mm, linux-kernel, Andrew Morton

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@oracle.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-12 14:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 14:53 [PATCH Fix] test_maple_tree: Fix accounting in check_erase2_testset() Liam Howlett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox