From: Liam R. Howlett Date: Thu, 3 Mar 2022 03:22:37 +0000 (-0500) Subject: maple_tree: Fix spannint store mast->r->max X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ea5493cd499f1a692370e6604a08c3e102c1a41d;p=users%2Fjedix%2Flinux-maple.git maple_tree: Fix spannint store mast->r->max Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index cf7d415441ca..a53dc391f055 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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; } }