On Thu 05-06-25 14:51:52, Andrew Morton wrote: > On Thu, 5 Jun 2025 10:22:23 +0200 Jan Kara <jack@xxxxxxx> wrote: > > > On Thu 05-06-25 13:49:35, Chi Zhiling wrote: > > > From: Chi Zhiling <chizhiling@xxxxxxxxxx> > > > > > > max_scan in page_cache_next_miss always decreases to zero when no hole > > > is found, causing the return value to be index + 0. > > > > > > Fix this by preserving the max_scan value throughout the loop. > > > > > > Fixes: 901a269ff3d5 ("filemap: fix page_cache_next_miss() when no hole found") > > > Signed-off-by: Chi Zhiling <chizhiling@xxxxxxxxxx> > > > > Indeed. Thanks for catching this. Don't know how I missed that. Feel free > > to add: > > > > Reviewed-by: Jan Kara <jack@xxxxxxx> > > > > Thanks. It's a simple patch - do we expect it to have significant > runtime effects? I'm not sure if Chi Zhiling observed some practical effects. From what I know and have seen in the past, wrong responses from page_cache_next_miss() can lead to readahead window reduction and thus reduced read speeds. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR