]> git.ipfire.org Git - thirdparty/linux.git/commit
filemap: fix page_cache_next_miss() when no hole found
authorJan Kara <jack@suse.cz>
Tue, 25 Jun 2024 10:18:52 +0000 (12:18 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:30:27 +0000 (19:30 -0700)
commit901a269ff3d59c9ee0e6be35c6044dc4bf2c0fdf
treeae361b503c084f389eb319eecda6ca11120de5b9
parent8051b82a0be05751e41be1dfa4201c131e589450
filemap: fix page_cache_next_miss() when no hole found

page_cache_next_miss() should return value outside of the specified range
when no hole is found.  However currently it will return the last index
*in* the specified range confusing ondemand_readahead() to think there's a
hole in the searched range and upsetting readahead logic.

Link: https://lkml.kernel.org/r/20240625101909.12234-2-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Tested-by: Zhang Peng <zhangpengpeng0808@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/filemap.c