Re: [PATCH v8 08/15] f2fs: make GC migration large-folio aware

From: Chao Yu

Date: Wed Oct 28 2026 - 21:33:09 EST


On 10/28/26 23:43, Nanzhe Zhao wrote:
> From: Nanzhe Zhao <zhaonanzhe@xxxxxxxxxx>
>
> GC can operate on a 4K block that is cached inside a large folio.
> The data lookup helpers therefore need to test and update uptodate
> state for the addressed subpage instead of rejecting large folios or
> treating the whole folio as the target block.
>
> Let f2fs_get_read_data_folio() and f2fs_get_lock_data_folio() to use
> subpage uptodate state. Submit single-block reads at the requested
> folio offset and zero only the addressed 4K range for NEW_ADDR.
>
> Also update `move_data_page` to mark, clear, and restore dirty
> state for the target subpage, and submit write I/O with the subpage
> offset recorded in f2fs_io_info.
>
> The write_pages_pending reference is taken by f2fs_do_write_data_page()
> and dropped from its common error path, so a block that is truncated
> concurrently no longer leaks the counter.
>
> Reported-by: kernel test robot <yi1.lai@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-lkp/202610081027.b13dcf10-lkp@xxxxxxxxx
> Signed-off-by: Nanzhe Zhao <zhaonanzhe@xxxxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,