From 540d34c18272d124ef3113b7dbe499304ce0023c Mon Sep 17 00:00:00 2001 From: Yongpeng Yang Date: Fri, 9 Jan 2026 22:46:18 +0800 Subject: [PATCH] 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 --- fs/f2fs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- 2.47.3