]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix potential insufficient nodes on mas_spanning_rebalance()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 20 Apr 2022 13:36:02 +0000 (09:36 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 20 Apr 2022 13:36:06 +0000 (09:36 -0400)
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 <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 3c78e63efaecc215222df598800f49a5b9a0a091..d6a10216521e3648f47bc4b8eaa3be9f0ef674a8 100644 (file)
@@ -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