Re: [f2fs-dev] [RFC PATCH v2 01/10] f2fs: extend folio state for large folio write path

From: Nanzhe Zhao

Date: Mon Jul 06 2026 - 04:32:40 EST


Hi Chao,

Yes, this can happen. By design, prepare_large_folio_write_begin() skips
f2fs_folio_state allocation when the write fully covers the entire large
folio (i.e., the folio is already uptodate or len == folio_size(folio)).
This is an optimization for normal buffered writes; I somehow didn't apply
the same optimization to atomic buffered writes since they are relatively
rare.

In that case, f2fs_update_dirty_folio() may call folio_set_f2fs_reference()
on a large folio that does not yet have an ffs, so the flag is stored
directly in folio->private.

But I agree this is a bit subtle and worth discussing.

Thanks,
Nanzhe