From 0773dfda2194064a88d5331876a24882ceec6d03 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 20 Apr 2022 09:36:02 -0400 Subject: [PATCH] maple_tree: Fix potential insufficient nodes on mas_spanning_rebalance() When a spanning store occurs at a non-root node but causes an insufficient leave, mas_spanning_rebalance() was not detecting it as a non-root node. This only happened when the spanning write was detected at the root node. 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 3c78e63efaec..d6a10216521e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2894,7 +2894,7 @@ static int mas_spanning_rebalance(struct ma_state *mas, mast->free = &free; mast->destroy = &destroy; l_mas.node = r_mas.node = m_mas.node = MAS_NONE; - if (!mas_is_root_limits(mas) && + if (!mas_is_root_limits(mast->orig_l) && unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) { /* * Do not free the current node as it may be freed in a bulk -- 2.34.1