On Tue, Mar 04, 2025 at 01:19:52AM +0000, Wei Yang wrote: > The comment of interval_tree_span_iter_next_gap() is not exact, nodes[1] > is not always !NULL. > > There are threes cases here. If there is an interior hole, the statement > is correct. If there is a tailing hole or the contiguous used range span > to the end, nodes[1] is NULL. > > Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> > CC: Matthew Wilcox <willy@xxxxxxxxxxxxx> > CC: Michel Lespinasse <michel@xxxxxxxxxxxxxx> > CC: Jason Gunthorpe <jgg@xxxxxxxx> > --- > lib/interval_tree.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx> > @@ -20,9 +20,15 @@ EXPORT_SYMBOL_GPL(interval_tree_iter_next); > /* > * Roll nodes[1] into nodes[0] by advancing nodes[1] to the end of a contiguous > * span of nodes. This makes nodes[0]->last the end of that contiguous used span > + * indexes that started at the original nodes[1]->start. "span [of] indexes" Jason