mas_mab_cp() copy range [mas_start, mas_end] inclusively, so we just need to copy to mas->end which points to the last valid data in maple node. Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a4796101decc..51f49b29b8b0 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2099,7 +2099,7 @@ static noinline_for_kasan void mas_store_b_node(struct ma_wr_state *wr_mas, goto b_end; /* Copy end data to the end of the node. */ - mas_mab_cp(mas, slot, mas->end + 1, b_node, ++b_end); + mas_mab_cp(mas, slot, mas->end, b_node, ++b_end); b_node->b_end--; return; -- 2.34.1