]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: Fix error in splitting on the right side
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 29 Jan 2019 20:06:00 +0000 (15:06 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:28:02 +0000 (12:28 -0500)
commit44ee19c50b32c467029c4bf887ab27b1f80c1ca4
treeee6beb82939506927d55ac347227bda06bd28eb0
parent7dcd92556235f05538544a58caf25f2a990ac974
maple_tree: Fix error in splitting on the right side

When splitting on the right side, there were a number of logical
errors:
1. Finding the parents type needed the parent to be encoded, so move the
logic to a location better suited to use the encoded node.
2. ma_copy had an incorrect range (off by one).
3. mt_replace was not using the encoded node to find the parent's slot.
This would always return zero.
4. ma_link had a potential overflow in the pivot.
5. The ma_state's min/max was not being updated and so the pivots were
not always correct when using the min/max.
6. The data end detection needed to be updated to also check for
ULONG_MAX.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c
lib/test_maple_tree.c