[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250407231354.11771-1-richard.weiyang@gmail.com>
Date: Mon, 7 Apr 2025 23:13:51 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: Liam.Howlett@...cle.com,
akpm@...ux-foundation.org,
willy@...radead.org
Cc: linux-kernel@...r.kernel.org,
maple-tree@...ts.infradead.org,
linux-mm@...ck.org,
Wei Yang <richard.weiyang@...il.com>
Subject: [RESEND Patch v2 0/3] maple_tree: Fix the replacement of a root leaf node
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: Fix mt_destroy_walk() on root leaf node
maple_tree: restart walk on correct status
maple_tree: assert retrieving new value on a tree containing just a
leaf node
lib/maple_tree.c | 3 ++-
tools/testing/radix-tree/maple.c | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
--
2.34.1
Powered by blists - more mailing lists