From 5e6d249a7cee739599028511f5fafad58a24edc0 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 21 Oct 2020 15:38:48 -0400 Subject: [PATCH] test_maple_tree: Test poping all pushed nodes to ensure mas_allocated is set correctly Signed-off-by: Liam R. Howlett --- lib/test_maple_tree.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index d3cfe8876009..50cd60f5e04c 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -341,6 +341,12 @@ static noinline void check_new_node(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != i - j); } MT_BUG_ON(mt, mas_allocated(&mas) != i); + for (j = 0; j <= i/2; j++) { + MT_BUG_ON(mt, mas_allocated(&mas) != i - j); + mn = mas_pop_node(&mas); + ma_free_rcu(mn); + MT_BUG_ON(mt, mas_allocated(&mas) != i - j - 1); + } MT_BUG_ON(mt, mas_nomem(&mas, GFP_KERNEL)); } -- 2.50.1