[PATCH] erofs: initialized fields can only be observed after bit is set

Chao Yu chao at kernel.org
Thu Feb 11 14:45:20 AEDT 2021


On 2021/2/9 21:06, Gao Xiang via Linux-erofs wrote:
> From: Gao Xiang <hsiangkao at redhat.com>
> 
> Currently, although set_bit() & test_bit() pairs are used as a fast-
> path for initialized configurations. However, these atomic ops are
> actually relaxed forms. Instead, load-acquire & store-release form is
> needed to make sure uninitialized fields won't be observed in advance
> here (yet no such corresponding bitops so use full barriers instead.)
> 
> Fixes: 62dc45979f3f ("staging: erofs: fix race of initializing xattrs of a inode at the same time")
> Fixes: 152a333a5895 ("staging: erofs: add compacted compression indexes support")
> Cc: <stable at vger.kernel.org> # 5.3+
> Reported-by: Huang Jianan <huangjianan at oppo.com>
> Signed-off-by: Gao Xiang <hsiangkao at redhat.com>

Thanks for detailed explanation for barrier offline.

Reviewed-by: Chao Yu <yuchao0 at huawei.com>

Thanks,


More information about the Linux-erofs mailing list