[PATCH Fix 2/2] test_maple_tree: Add test for spanning store to most of the tree

From: Liam Howlett
Date: Wed Jun 29 2022 - 11:24:07 EST


Test spanning almost the entire tree to detect if the root is dead and
the node is placed in the wrong location.

Fixes: 1d3ae73e4e86 (test_maple_tree: Add test for spanning store to most of the tree)
Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
---
lib/test_maple_tree.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c
index 8de5705b7b9b..b028f5648857 100644
--- a/lib/test_maple_tree.c
+++ b/lib/test_maple_tree.c
@@ -35685,7 +35685,6 @@ static noinline void check_spanning_write(struct maple_tree *mt)
mas_set(&mas, 1205);
MT_BUG_ON(mt, mas_walk(&mas) != NULL);
mtree_unlock(mt);
- mt_dump(mt);
mt_validate(mt);
mtree_destroy(mt);

@@ -35817,6 +35816,15 @@ static noinline void check_spanning_write(struct maple_tree *mt)
MT_BUG_ON(mt, mas_walk(&mas) != NULL);
mtree_unlock(mt);
mtree_destroy(mt);
+
+ mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE);
+ for (i = 0; i <= 100; i++)
+ mtree_test_store_range(mt, i * 10, i * 10 + 5, &i);
+
+ mtree_lock(mt);
+ mas_set_range(&mas, 76, 875);
+ mas_store_gfp(&mas, NULL, GFP_KERNEL);
+ mtree_unlock(mt);
}

static noinline void check_null_expand(struct maple_tree *mt)
--
2.35.1