Skip to content
Commit ce063129 authored by Gao Xiang's avatar Gao Xiang
Browse files

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

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.)

Link: https://lore.kernel.org/r/20210209130618.15838-1-hsiangkao@aol.com


Fixes: 62dc4597 ("staging: erofs: fix race of initializing xattrs of a inode at the same time")
Fixes: 152a333a ("staging: erofs: add compacted compression indexes support")
Cc: <stable@vger.kernel.org> # 5.3+
Reported-by: default avatarHuang Jianan <huangjianan@oppo.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarGao Xiang <hsiangkao@redhat.com>
parent bde54529
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment