[PATCH Fix] test_maple_tree: Fix accounting in check_erase2_testset()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux