From 46b2095befb73ee4ae6e94597403bc53d6f861d4 Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Sat, 12 Oct 2019 23:23:46 -0400 Subject: [PATCH] maple_tree: Fix test check_find Lock the tree before beginning the iteration and unlock it after we've finished. Also destroy the tree so subsequent users of the tree aren't confused by the detritus from this test. Signed-off-by: Matthew Wilcox (Oracle) --- lib/test_maple_tree.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index be76a04d2526..87e6bd903508 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -430,8 +430,8 @@ static noinline void check_find(struct maple_tree *mt) /* Test mas_pause */ val = 0; - mas_reset(&mas); - mas.index = val; + mas_set(&mas, val); + mas_lock(&mas); mas_for_each(&mas, entry, ULONG_MAX) { if (val != 64) MT_BUG_ON(mt, xa_mk_value(val) != entry); @@ -448,6 +448,7 @@ static noinline void check_find(struct maple_tree *mt) mas_lock(&mas); } } + mas_unlock(&mas); val = 0; max = 300; // A value big enough to include XA_ZERO_ENTRY at 64. @@ -461,7 +462,7 @@ static noinline void check_find(struct maple_tree *mt) val = 1; } - + mtree_destroy(mt); } @@ -941,6 +942,7 @@ static noinline void check_alloc_range(struct maple_tree *mt) mtree_destroy(mt); } + static noinline void check_ranges(struct maple_tree *mt) { unsigned long r[] = { -- 2.50.1