Skip to contentSkip to conversation

radix-tree: fix deleting a multi-order entry through an alias

PATCH New [email protected] 1 participant 1 message May 21, 2016 Library code

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 109/162 radix-tree: fix deleting a multi-order entry through an alias

From: Matthew Wilcox <[email protected]>
Subject: radix-tree: fix deleting a multi-order entry through an alias

If we deleted an entry through an index which looked up a sibling pointer, we'd end up zeroing out the wrong slots in the node. Use get_slot_offset() to find the right slot.

Cc Konstantin Khlebnikov <[email protected]>
Cc Kirill Shutemov <[email protected]>
Cc Jan Kara <[email protected]>
Cc Neil Brown <[email protected]>

---

 lib/radix-tree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/radix-tree.c renamed from lib/radix-tree.c~radix-tree-fix-deleting-a-multi-order-entry-through-an-alias +1 -1
diff -puN lib/radix-tree.c~radix-tree-fix-deleting-a-multi-order-entry-through-an-alias lib/radix-tree.c
@@ -1558,7 +1558,7 @@ void *radix_tree_delete_item(struct radi
 		return entry;
 	}
 
-	offset = index & RADIX_TREE_MAP_MASK;
+	offset = get_slot_offset(node, slot);
 
 	/*
 	 * Clear all tags associated with the item to be deleted.

_