Re: [PATCH] rbtree: stop iteration early in rb_find_first

From: Peter Zijlstra
Date: Wed Aug 25 2021 - 08:32:30 EST


On Wed, Aug 25, 2021 at 04:58:59AM -0700, Michel Lespinasse wrote:
> Actually, my explanation is wrong too :) but so is the code.
> A failing example would searching 10 in the following tree
>
>
> 10
> /
> 5
> \
> 10
>
> The search would stop after visiting node 5, and miss the leaf which
> is the expected node to be returned.

Ah! You're quite right.