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 advancing index and offset unconditionally in the loop iteration, so they are updated even when the zeroing path continues. Signed-off-by: Nanzhe Zhao <[email protected]> --- fs/f2fs/data.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index ddabcb1b9882..18952daa8d8b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2458,7 +2458,7 @@ static int f2fs_read_data_large_folio(struct inode *inode, ffs = NULL; nrpages = folio_nr_pages(folio); - for (; nrpages; nrpages--) { + for (; nrpages; nrpages--, index++, offset++) { sector_t block_nr; /* * Map blocks using the previous result first. @@ -2543,8 +2543,6 @@ static int f2fs_read_data_large_folio(struct inode *inode, f2fs_update_iostat(F2FS_I_SB(inode), NULL, FS_DATA_READ_IO, F2FS_BLKSIZE); last_block_in_bio = block_nr; - index++; - offset++; } trace_f2fs_read_folio(folio, DATA); if (rac) { -- 2.34.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
