Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the indirect_ptr bit is set on a slot, that indicates we need to redo the lookup. Introduce a new function radix_tree_iter_retry() which forces the loop to retry the lookup by setting 'slot' to NULL and turning the iterator back to point at the problematic entry. This is a pretty rare problem to hit at the moment; the lookup has to race with a grow of the radix tree from a height of 0. The consequences of hitting this race are that gang lookup could return a pointer to a radix_tree_node instead of a pointer to whatever the user had inserted in the tree. Fixes: cebbd29 ("radix-tree: rewrite gang lookup using iterator") Signed-off-by: Matthew Wilcox <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Ohad Ben-Cohen <[email protected]> Cc: Konstantin Khlebnikov <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information