]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
f2fs: Zero f2fs_folio_state on allocation
authorNanzhe Zhao <nzzhao@126.com>
Mon, 5 Jan 2026 15:30:57 +0000 (23:30 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 7 Jan 2026 03:17:08 +0000 (03:17 +0000)
commit00feea1dfcea2cc7c22e58b6325f72637c6ea217
tree84999d6b25bc4462c15fe6b07997e76ce386fba4
parentd36de29f4bb59b24e57ff22403baae6fc7e89bd8
f2fs: Zero f2fs_folio_state on allocation

f2fs_folio_state is attached to folio->private and is expected to start
with read_pages_pending == 0.  However, the structure was allocated from
ffs_entry_slab without being fully initialized, which can leave
read_pages_pending with stale values.

Allocate the object with __GFP_ZERO so all fields are reliably zeroed at
creation time.

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