f2fs: avoid unnecessary block mapping lookups in f2fs_read_data_large_folio

In the second call to f2fs_map_blocks within f2fs_read_data_large_folio,
map.m_len exceeds the logical address space to be read. This patch
ensures map.m_len does not exceed the required address space.

Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Yongpeng Yang 2026-01-09 22:46:18 +08:00 committed by Jaegeuk Kim
parent 93ffb6c28f
commit 540d34c182

View File

@ -2468,7 +2468,7 @@ static int f2fs_read_data_large_folio(struct inode *inode,
ffs = NULL;
nrpages = folio_nr_pages(folio);
for (; nrpages; nrpages--) {
for (; nrpages; nrpages--, max_nr_pages--) {
sector_t block_nr;
/*
* Map blocks using the previous result first.