linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix mas_skip_node() for mas_empty_area()
@ 2023-03-07 18:02 Liam R. Howlett
  2023-03-07 18:02 ` [PATCH v2 1/2] maple_tree: Fix mas_skip_node() end slot detection Liam R. Howlett
  2023-03-07 18:02 ` [PATCH v2 2/2] test_maple_tree: Add more testing for mas_empty_area() Liam R. Howlett
  0 siblings, 2 replies; 4+ messages in thread
From: Liam R. Howlett @ 2023-03-07 18:02 UTC (permalink / raw)
  To: maple-tree, linux-mm, linux-kernel, Andrew Morton, Stable,
	zhangpeng.00, snild
  Cc: Liam R. Howlett

Andrew, this should replace these patches in mm-hotfixes-unstable:
400922513f30 ("maple_tree: fix mas_skip_node() end slot detection")
4d4ec28ef3a4 ("test_maple_tree: add more testing for mas_empty_area()")

mas_empty_area() was incorrectly returning an error when there was room.
The issue was tracked down to mas_skip_node() using the incorrect
end-of-slot count.  Instead of using the nodes hard limit, the limit of
data should be used.

mas_skip_node() was also setting the min and max to that of the child
node, which was unnecessary.  Within these limits being set, there was
also a bug that corrupted the maple state's max if the offset was set to
the maximum node pivot.  The bug was without consequence unless there
was a sufficient gap in the next child node which would cause an error
to be returned.

This patch set fixes these errors by removing the limit setting from
mas_skip_node() and uses the mas_data_end() for slot limits, and adds
tests for all failures discovered.

Liam R. Howlett (2):
  maple_tree: Fix mas_skip_node() end slot detection
  test_maple_tree: Add more testing for mas_empty_area()

 lib/maple_tree.c      | 24 +++++-----------------
 lib/test_maple_tree.c | 48 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 19 deletions(-)

-- 
2.39.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-08  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 18:02 [PATCH v2 0/2] Fix mas_skip_node() for mas_empty_area() Liam R. Howlett
2023-03-07 18:02 ` [PATCH v2 1/2] maple_tree: Fix mas_skip_node() end slot detection Liam R. Howlett
2023-03-08  8:49   ` Snild Dolkow
2023-03-07 18:02 ` [PATCH v2 2/2] test_maple_tree: Add more testing for mas_empty_area() Liam R. Howlett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox