Re: [f2fs-dev] [PATCH 13/14] f2fs: allow large folio support to writeable files
From: Nanzhe Zhao
Date: Mon Sep 07 2026 - 02:34:03 EST
On Fri, 28 Aug 2026 10:44:46 -0700, Daeho Jeong wrote:
> In F2FS, newly created files almost always start with inline_data
> (`FI_INLINE_DATA`).
> Because f2fs_has_inline_data() is true during f2fs_new_inode() / f2fs_iget(),
> mapping_set_large_folios is skipped.
> When the file later expands and is converted to regular blocks in
> f2fs_convert_inline_inode(),
> `f2fs_mapping_set_large_folio()` is NEVER called.
> As a result, almost NO newly created file will ever use Large Folios
> during its lifetime.
> Fix: Call `f2fs_mapping_set_large_folio(inode)` inside
> `f2fs_convert_inline_inode()` once
> inline data is converted. Also consider using the standard
> `mapping_set_large_folios(mapping)`
> helper instead of `mapping_set_folio_min_order(mapping, 0)`.
I'm concerned that calling mapping_set_large_folios() here would
violate the specification for enabling large folios on a file, because
we would be enabling large folios on an active inode. Please take a
look at the comment of mapping_set_large_folios() in
include/linux/pagemap.h.
Thanks,
Nanzhe