[f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks

Yangyang Zang <[email protected]>
Newsgroups net.sourceforge.lists.linux-f2fs-devel
Message-ID <[email protected]>
When the current block is not contiguous with the in-progress readahead
range, f2fs_ra_meta_pages() issues the pending range but keeps the old
start block and length.

As a result, the current block is not included in any readahead range,
and subsequent non-contiguous blocks keep reissuing the stale range
instead of starting a new one.

Reset start_blk and len after issuing the pending range so readahead can
continue from the current block.

Signed-off-by: Yangyang Zang <[email protected]>
---
 fsck/mount.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fsck/mount.c b/fsck/mount.c
index 2f4e6c92bf6c..ea171a4c97c5 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -901,6 +901,8 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
 		} else {
 			dev_readahead(start_blk << F2FS_BLKSIZE_BITS,
 						len << F2FS_BLKSIZE_BITS);
+			start_blk = blkaddr;
+			len = 1;
 		}
 	}
 out:
-- 
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.