]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: Revise limit checks in mas_empty_area{_rev}()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 20 Apr 2023 13:17:34 +0000 (09:17 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 24 Apr 2023 20:20:43 +0000 (16:20 -0400)
commit657d6d7e29c5e4f057bc4f28a374e163af29a105
treeb3adba094afc35d23a09661375f0bed966008efb
parent0880a7f00fc6d2216cedd537f62decfe6f6f96f4
maple_tree: Revise limit checks in mas_empty_area{_rev}()

Since the maple tree is inclusive in range, ensure that a range of 1
(min = max) works for searching for a gap in either direction, and make
sure the size is at least 1 but not larger than the delta between min
and max.

This commit also updates the testing.  Unfortunately there isn't a way
to safely update the tests and code without a test failure.

Suggested-by: Peng Zhang <zhangpeng.00@bytedance.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c
lib/test_maple_tree.c