From: Liam R. Howlett Date: Wed, 20 Apr 2022 13:36:02 +0000 (-0400) Subject: maple_tree: Fix potential insufficient nodes on mas_spanning_rebalance() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0773dfda2194064a88d5331876a24882ceec6d03;p=users%2Fjedix%2Flinux-maple.git 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 --- 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