Re: [PATCH] lib/idr: fix ida_find_first_range() missing IDs across chunk boundaries

From: Matthew Wilcox

Date: Fri Mar 06 2026 - 15:29:43 EST


On Fri, Mar 06, 2026 at 08:25:42PM +0000, Josh Law wrote:
> 6 Mar 2026 20:15:29 Matthew Wilcox <willy@xxxxxxxxxxxxx>:
>
> > On Fri, Mar 06, 2026 at 08:03:19PM +0000, Josh Law wrote:
> >> ida_find_first_range() only examines the first XArray entry returned by
> >> xa_find(). If that entry does not contain a set bit at or above the
> >> requested offset, the function returns -ENOENT without searching
> >> subsequent entries, even though later chunks may contain allocated IDs
> >> within the requested range.
> >
> > Can I trouble you to add a test to lib/test_ida.c to demonstrate the
> > problem (and that it's fixed, and that it doesn't come back)?
> >
> > Also this needs a Fixes: line.  I suggest 7fe6b987166b is the commit
> > it's fixing.  Add Jason and Yi Liu as well as the author and committer
> > of that patch.
>
> Okay, you mind if I put the modifications to test_ida.c on the same commit? Or would you like it on another commit

I like it as part of the same commit (as 7fe6b987166b did), but honestly
I'm just happy to get improvements to the test suite no matter how they
come.