Re: [f2fs-dev] [PATCH v2 10/20] f2fs: support subpage blocks in collapse and insert range

From: Chao Yu

Date: Tue Nov 17 2026 - 06:13:37 EST


On 11/16/26 12:08, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@xxxxxxxxxx>
>
> The folio holding offset may hold blocks before the shifted range.
> Write back the page cache from the PAGE_SIZE boundary below offset
> under invalidate_lock before truncating it from there, so that no
> data is lost. Detect src and dst in the same folio by folio index
> instead of block index, as a folio holds several blocks. Remove the
> -EOPNOTSUPP check.
>
> Also take i_gc_rwsem[WRITE] and invalidate_lock before that writeback
> and keep them until the moved blocks are written back and the page
> cache is dropped, as move range does. After the block exchange, the
> page cache holds the old data of the source blocks until then. With
> subpage blocks, page_mkwrite dirties every block of a folio up to EOF,
> so a store to a neighbouring block in between writes the old data back,
> over a hole or over the moved data. This also keeps GC away from the
> inode until then, for any block size.
>
> Signed-off-by: Daeho Jeong <daehojeong@xxxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,