[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260105153101.152892-6-nzzhao@126.com>
Date: Mon, 5 Jan 2026 23:31:01 +0800
From: Nanzhe Zhao <nzzhao@....com>
To: Kim Jaegeuk <jaegeuk@...nel.org>
Cc: Chao Yu <chao@...nel.org>,
linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org,
Nanzhe Zhao <nzzhao@....com>
Subject: [PATCH v1 5/5] f2fs: advance index and offset after zeroing in large folio read
In f2fs_read_data_large_folio(), the block zeroing path calls
folio_zero_range() and then continues the loop. However, it fails to
advance index and offset before continuing.
This can cause the loop to repeatedly process the same subpage of the
folio, leading to stalls/hangs and incorrect progress when reading large
folios with holes/zeroed blocks.
Fix it by incrementing index and offset in the zeroing path before
continuing.
Signed-off-by: Nanzhe Zhao <nzzhao@....com>
---
fs/f2fs/data.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index ac569a396914..07c222bcc5e0 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -2446,7 +2446,7 @@ static int f2fs_read_data_large_folio(struct inode *inode,
if (!folio)
goto out;
- folio_in_bio = false
+ folio_in_bio = false;
index = folio->index;
offset = 0;
ffs = NULL;
@@ -2483,6 +2483,8 @@ static int f2fs_read_data_large_folio(struct inode *inode,
ret = -EIO;
goto err_out;
}
+ index++;
+ offset++;
continue;
} else if((map.m_flags & F2FS_MAP_MAPPED)) {
block_nr = map.m_pblk + index - map.m_lblk;
--
2.34.1
Powered by blists - more mailing lists