]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
test_maple_tree: Test poping all pushed nodes to ensure mas_allocated is set correctly
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 21 Oct 2020 19:38:48 +0000 (15:38 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:13:28 +0000 (15:13 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/test_maple_tree.c

index d3cfe8876009ab7a091c7091afc5e64d3ef7aa5d..50cd60f5e04ce02b9518ec5c56337397e34739bf 100644 (file)
@@ -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));
 
        }