From: Matthew Wilcox Date: Sat, 21 May 2016 00:02:02 +0000 (-0700) Subject: radix-tree: fix deleting a multi-order entry through an alias X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=29e0967c2f66771f654cef7168c90a53737abcdf;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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. Signed-off-by: Matthew Wilcox Reviewed-by: Ross Zwisler Cc: Konstantin Khlebnikov Cc: Kirill Shutemov Cc: Jan Kara Cc: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/radix-tree.c b/lib/radix-tree.c index c0366d1d2613..b3364b9ecc83 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -1558,7 +1558,7 @@ void *radix_tree_delete_item(struct radix_tree_root *root, return entry; } - offset = index & RADIX_TREE_MAP_MASK; + offset = get_slot_offset(node, slot); /* * Clear all tags associated with the item to be deleted.