]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix spannint store mast->r->max
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 3 Mar 2022 03:22:37 +0000 (22:22 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 8 Mar 2022 18:19:16 +0000 (13:19 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index cf7d415441ca72880ddc6d822b86c6a97f434ae6..a53dc391f0558a195a292ae354631cb002a1963b 100644 (file)
@@ -2680,22 +2680,19 @@ 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);
-       if (split == mast->bn->b_end) {
+       if (split == mast->bn->b_end)
                mast->l->max = mast->orig_r->max;
-       }
 
        if (middle) {
                mab_mas_cp(mast->bn, 1 + split, mid_split, mast->m, true);
                mast->m->min = mast->bn->pivot[split] + 1;
-               mast->m->max = mast->bn->pivot[mid_split];
                split = mid_split;
        }
 
+       mast->r->max = mast->orig_r->max;
        if (right) {
-               mab_mas_cp(mast->bn, 1 + split, mast->bn->b_end, mast->r, true);
+               mab_mas_cp(mast->bn, 1 + split, mast->bn->b_end, mast->r, false);
                mast->r->min = mast->bn->pivot[split] + 1;
-       } else {
-               mast->r->max = mast->l->max;
        }
 }