linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] may miss to set node dead on destroy
@ 2025-02-08  1:18 Wei Yang
  2025-02-08  1:18 ` [PATCH 1/3] maple_tree: " Wei Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Wei Yang @ 2025-02-08  1:18 UTC (permalink / raw)
  To: akpm, Liam.Howlett; +Cc: maple-tree, linux-mm, Wei Yang

Per my understanding, on destroy we should set each node dead. But current
code miss this when the maple tree has only the root node.
    
The reason is mt_destroy_walk() leverage mte_destroy_descend() to set
node dead, but this is skipped since the only root node is a leaf.

Patch 1 fixes this.

When adding a test case, I found we always get the new value even we leave the
old root node not dead. It turns out we always re-walk the tree in mas_walk().
It looks like a typo on the status check of mas_walk().

Patch 2 fixes this.

Patch 3 add a test case to assert retrieving new value when overwriting the
whole range to a tree with only root node

Wei Yang (3):
  maple_tree: may miss to set node dead on destroy
  maple_tree: restart walk on correct status
  maple_tree: assert retrieving new value on a tree with only root node

 lib/maple_tree.c                 |  4 +++-
 tools/testing/radix-tree/maple.c | 24 ++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

-- 
2.34.1



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

end of thread, other threads:[~2025-03-05  0:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-08  1:18 [PATCH 0/3] may miss to set node dead on destroy Wei Yang
2025-02-08  1:18 ` [PATCH 1/3] maple_tree: " Wei Yang
2025-02-10 14:19   ` Liam R. Howlett
2025-02-11  7:48     ` Wei Yang
2025-02-11 15:23       ` Liam R. Howlett
2025-02-12  0:26         ` Wei Yang
2025-02-08  1:18 ` [PATCH 2/3] maple_tree: restart walk on correct status Wei Yang
2025-02-10 14:20   ` Liam R. Howlett
2025-02-08  1:18 ` [PATCH 3/3] maple_tree: assert retrieving new value on a tree with only root node Wei Yang
2025-02-10 14:18   ` Liam R. Howlett
2025-02-11  8:02     ` Wei Yang
2025-02-11 15:25       ` Liam R. Howlett
2025-02-12  0:41         ` Wei Yang
2025-02-10 14:31 ` [PATCH 0/3] may miss to set node dead on destroy Liam R. Howlett
2025-02-11  8:11   ` Wei Yang
2025-02-11 15:28     ` Liam R. Howlett
2025-02-12  0:49       ` Wei Yang
2025-02-12  0:55       ` Wei Yang
2025-03-04 12:07         ` Wei Yang
2025-03-04 14:45           ` Liam R. Howlett
2025-03-05  0:32             ` Wei Yang

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