From 176abe99f6d8a10e8c09fae68ed5f88c1ae6333a Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 2 Mar 2022 11:23:34 -0500 Subject: [PATCH] maple_tree: Fix spanning store on two node rebalance Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; } } -- 2.50.1