Re: [PATCH] f2fs: skip node_change lock for inline data writes
From: Chao Yu
Date: Wed Sep 09 2026 - 08:34:00 EST
On 9/6/26 22:56, Seongjae Jeong wrote:
> The node_change lock serializes block reservation in the PRE_AIO path
> against checkpoint preparation, since block reservation can create
> dirty node pages and update checkpoint accounting.
>
> However, writes that remain within the inline data area return before
> the block reservation path. Thus, they do not call
> inc_valid_block_count(), change a node mapping from NULL_ADDR to
> NEW_ADDR, or create a dirty node page as a result of block reservation.
> They also do not update total_valid_block_count or
> alloc_valid_block_count.
>
> The inline path only copies the existing inline data to the data folio,
> sets FI_DATA_EXIST, and marks the inode folio for deferred inline data
> flushing. FI_DATA_EXIST can dirty inode metadata, but it does not
> reserve a block or update the node mapping and checkpoint accounting
> that node_change is intended to serialize.
>
> Skip f2fs_map_lock() for writes that fit within MAX_INLINE_DATA. Keep
> the existing locking for inline conversion, which can update filesystem
> metadata and requires checkpoint serialization.
>
> Signed-off-by: Seongjae Jeong <jsjlee1020@xxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
Thanks,