summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/maple_tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 54484bd756e5..6b451a432738 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -1352,12 +1352,16 @@ static inline struct maple_enode *mas_start(struct ma_state *mas)
 		mas->max = ULONG_MAX;
 		mas->depth = 0;
 
+retry:
 		root = mas_root(mas);
 		/* Tree with nodes */
 		if (likely(xa_is_node(root))) {
 			mas->depth = 1;
 			mas->node = mte_safe_root(root);
 			mas->offset = 0;
+			if (mte_dead_node(mas->node))
+				goto retry;
+
 			return NULL;
 		}