Re: [f2fs-dev] [PATCH] f2fs: annotate data races around fi->i_flags
From: Eric Biggers
Date: Wed Mar 18 2026 - 22:58:17 EST
On Thu, Mar 19, 2026 at 10:23:35AM +0800, Cen Zhang wrote:
> fi->i_flags can be read by f2fs_update_inode() in the writeback path,
> f2fs_getattr(), and f2fs_fileattr_get() without holding inode_lock or
> fi->i_sem, while it can be concurrently written by
> f2fs_setflags_common(), set_compress_context(), and
> f2fs_disable_compressed_file() under inode_lock and/or fi->i_sem.
>
> This is a data race as defined by the LKMM. Use READ_ONCE() on the
> read side and WRITE_ONCE() on the write side to ensure proper marking
> of the concurrent accesses.
>
> Fixes: 360985573b55 ("f2fs: separate f2fs i_flags from fs_flags and ext4 i_flags")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Cen Zhang <zzzccc427@xxxxxxxxx>
Is that really the correct Fixes commit? I don't see what it has to do
with this issue.
- Eric