From: Liam R. Howlett Date: Wed, 2 Mar 2022 16:23:34 +0000 (-0500) Subject: maple_tree: Fix spanning store on two node rebalance X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=176abe99f6d8a10e8c09fae68ed5f88c1ae6333a;p=users%2Fjedix%2Flinux-maple.git maple_tree: Fix spanning store on two node rebalance Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 521d1e63d77c..12e4787c4d83 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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; } }