From 769d8140ea1c169452c1900b727da2b46efc63f8 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 28 Sep 2020 15:19:36 -0400 Subject: [PATCH] maple_tree: Fix resetting depth to preserve depth for external mas calls Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e010b7881893..2c17eef5a426 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1013,6 +1013,7 @@ static inline struct maple_enode *mas_start(struct ma_state *mas) mas->node = MAS_NONE; mas->min = 0; mas->max = ULONG_MAX; + mas->depth = 0; mas_set_offset(mas, 0); if (!mas->tree->ma_root) // empty tree. goto done; @@ -2824,7 +2825,6 @@ bool mas_wr_walk(struct ma_state *mas, unsigned long *range_min, enum maple_type type; mas->span_enode = NULL; - mas->depth = 0; while (true) { type = mte_node_type(mas->node); mas->depth++; -- 2.50.1