Skip to content
Commit eff3860b authored by Matthew Wilcox's avatar Matthew Wilcox
Browse files

radix tree: Don't return retry entries from lookup



Commit 66ee620f ("idr: Permit any valid kernel pointer to be stored")
changed the radix tree lookup so that it stops when reaching the bottom
of the tree.  However, the condition was added in the wrong place,
making it possible to return retry entries to the caller.  Reorder the
tests to check for the retry entry before checking whether we're at the
bottom of the tree.  The retry entry should never be found in the tree
root, so it's safe to defer the check until the end of the loop.

Add a regression test to the test-suite to be sure this doesn't come
back.

Fixes: 66ee620f ("idr: Permit any valid kernel pointer to be stored")
Reported-by: default avatarGreg Kurz <groug@kaod.org>
Signed-off-by: default avatarMatthew Wilcox <willy@infradead.org>
parent cf76c364
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment