Re: [f2fs-dev] [PATCH v2] f2fs: release a removed xattr node in roll-forward recovery

From: Chao Yu

Date: Wed Oct 14 2026 - 23:28:13 EST


On 10/15/26 10:57, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@xxxxxxxxxx>
>
> When xattrs shrink enough to fit in the inline xattr area,
> write_all_xattrs() truncates the xattr node and clears i_xattr_nid. If
> the file is then fsynced without a checkpoint, only the inode block is
> written, with i_xattr_nid of 0.
>
> Roll-forward recovery starts from the checkpointed inode, whose
> i_xattr_nid still points to the old xattr node.
> f2fs_recover_inline_xattr() copies only the inline xattr area, and
> f2fs_update_inode() writes the old i_xattr_nid back. So the inode keeps
> the stale xattr node:
>
> - The node block is never released, and fsck reports "nonzero bytes in
> xattr space after end of list".
> - If the inline xattr list ends exactly at the end of the inline area,
> its terminator is read from the stale node, and the removed xattrs
> come back after recovery.
>
> When the fsynced inode has no xattr node but the checkpointed one has,
> release the old xattr node as truncate_node() does: check its block
> address, invalidate the block and drop its node cache, which may still
> be dirty.
>
> Fixes: 28cdce0459cc ("f2fs: recover inline xattr data in roll-forward process")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Daeho Jeong <daehojeong@xxxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,