Re: [PATCH v1] f2fs: dirty directory inodes on mtime/ctime update
From: Chao Yu
Date: Mon Jun 22 2026 - 23:36:17 EST
On 6/23/26 11:27, Joanne Chang wrote:
> Xfstests generic/547 sometimes fail with mismatched directory metadata
> before and after a power failure. This happens because when a directory
> entry is added, renamed, or deleted, its mtime and ctime are updated and
> the inode is marked dirty via
> f2fs_mark_inode_dirty_sync(dir, sync=false). The sync=false flag means
> the dirty inode is not added to the global DIRTY_META list. Therefore,
> subsequent checkpoints skip flushing these updated directory blocks,
> causing directory timestamps to revert to stale values after a sudden
> power failure.
>
> Address this by changing the dirtying parameter to sync=true during
> directory entry mutations and renames. This forces F2FS to immediately
> queue the updated directory blocks on the global DIRTY_META list,
> ensuring timestamps are committed to checkpoints.
>
Needs a Fixes line and Cc stable.
> Signed-off-by: Joanne Chang <joannechien@xxxxxxxxxx>
Anyway the code part looks good to me.
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
Thanks,