Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29e0967c authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds
Browse files

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: default avatarMatthew Wilcox <willy@linux.intel.com>
Reviewed-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Kirill Shutemov <kirill.shutemov@linux.intel.com>
Cc: Jan Kara <jack@suse.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3b8c00f6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.