From: Yongpeng Yang Date: Fri, 9 Jan 2026 14:46:18 +0000 (+0800) Subject: f2fs: avoid unnecessary block mapping lookups in f2fs_read_data_large_folio X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=540d34c18272d124ef3113b7dbe499304ce0023c;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 9b70b6d33703..7aa1cd43898f 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2468,7 +2468,7 @@ next_folio: 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.