Linux-f2fs-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/1] f2fs: avoid unnecessary block mapping lookups in f2fs_read_data_large_folio
@ 2026-01-09 14:46 Yongpeng Yang
  2026-01-12  1:05 ` Chao Yu via Linux-f2fs-devel
  2026-01-19 13:50 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
  0 siblings, 2 replies; 3+ messages in thread
From: Yongpeng Yang @ 2026-01-09 14:46 UTC (permalink / raw)
  To: Chao Yu, Jaegeuk Kim; +Cc: Yongpeng Yang, Yongpeng Yang, linux-f2fs-devel

From: Yongpeng Yang <yangyongpeng@xiaomi.com>

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>
---
 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 f32eb51ccee4..40c32267ead9 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -2456,7 +2456,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.
-- 
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-19 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09 14:46 [f2fs-dev] [PATCH 1/1] f2fs: avoid unnecessary block mapping lookups in f2fs_read_data_large_folio Yongpeng Yang
2026-01-12  1:05 ` Chao Yu via Linux-f2fs-devel
2026-01-19 13:50 ` patchwork-bot+f2fs--- via Linux-f2fs-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox