]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix spanning store on two node rebalance
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 2 Mar 2022 16:23:34 +0000 (11:23 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 8 Mar 2022 18:19:15 +0000 (13:19 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 521d1e63d77c3055fd43481df378b7672138c09c..12e4787c4d8361ea0e05687d05c6c09afb6444e7 100644 (file)
@@ -2679,10 +2679,8 @@ static inline void mast_cp_to_nodes(struct maple_subtree_state *mast,
 
        mast->l->min = mast->orig_l->min;
        mab_mas_cp(mast->bn, 0, split, mast->l, true);
-       mast->r->max = mast->l->max;
        if (split == mast->bn->b_end) {
                mast->l->max = mast->orig_r->max;
-               return;
        }
 
        if (middle) {
@@ -2695,7 +2693,8 @@ static inline void mast_cp_to_nodes(struct maple_subtree_state *mast,
        if (right) {
                mab_mas_cp(mast->bn, 1 + split, mast->bn->b_end, mast->r, true);
                mast->r->min = mast->bn->pivot[split] + 1;
-               mast->r->max = mast->bn->pivot[mast->bn->b_end];
+       } else {
+               mast->r->max = mast->l->max;
        }
 }