From: Liam R. Howlett Date: Wed, 21 Oct 2020 19:38:48 +0000 (-0400) Subject: test_maple_tree: Test poping all pushed nodes to ensure mas_allocated is set correctly X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=62d482d4d24a2742cb00a9bae8af840987593953;p=users%2Fjedix%2Flinux-maple.git test_maple_tree: Test poping all pushed nodes to ensure mas_allocated is set correctly Signed-off-by: Liam R. Howlett --- 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)); }