diff mbox series

[1/2] maple_tree: not necessary to check index/last again

Message ID 20241015233909.23592-2-richard.weiyang@gmail.com (mailing list archive)
State New
Headers show
Series fix mas_new_root() | expand

Commit Message

Wei Yang Oct. 15, 2024, 11:39 p.m. UTC
Before calling mas_new_root(), the range has been checked.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Liam R. Howlett <Liam.Howlett@Oracle.com>
CC: Sidhartha Kumar <sidhartha.kumar@oracle.com>
CC: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
---
 lib/maple_tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 0aa9fa8fa7de..3a12866a4a89 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -3594,7 +3594,7 @@  static inline void mas_new_root(struct ma_state *mas, void *entry)
 	void __rcu **slots;
 	unsigned long *pivots;
 
-	if (!entry && !mas->index && mas->last == ULONG_MAX) {
+	if (!entry) {
 		mas->depth = 0;
 		mas_set_height(mas);
 		rcu_assign_pointer(mas->tree->ma_root, entry);