]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
f2fs: add 'folio_in_bio' to handle readahead folios with no BIO submission
authorNanzhe Zhao <nzzhao@126.com>
Sun, 11 Jan 2026 10:09:40 +0000 (18:09 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 17 Jan 2026 00:00:35 +0000 (00:00 +0000)
commit6afd05ca6d45b834af36c8e1257e7203b2604583
tree9530ee178f0a49fa207948d8426391d735772bc5
parent540d34c18272d124ef3113b7dbe499304ce0023c
f2fs: add 'folio_in_bio' to handle readahead folios with no BIO submission

f2fs_read_data_large_folio() can build a single read BIO across multiple
folios during readahead. If a folio ends up having none of its subpages
added to the BIO (e.g. all subpages are zeroed / treated as holes), it
will never be seen by f2fs_finish_read_bio(), so folio_end_read() is
never called. This leaves the folio locked and not marked uptodate.

Track whether the current folio has been added to a BIO via a local
'folio_in_bio' bool flag, and when iterating readahead folios, explicitly
mark the folio uptodate (on success) and unlock it when nothing was added.

Signed-off-by: Nanzhe Zhao <nzzhao@126.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c