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

From
Chao Yu <chao@kernel.org>
Date
2021-02-11 03:46:18
Also in
lkml
Reply to
Gao Xiang, 2021-02-09
On 2021/2/9 21:06, Gao Xiang via Linux-erofs wrote:
From: Gao Xiang <redacted>

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: <redacted> # 5.3+
Reported-by: Huang Jianan <redacted>
Signed-off-by: Gao Xiang <redacted>
Thanks for detailed explanation for barrier offline.

Reviewed-by: Chao Yu <redacted>

Thanks,
Thread (4 messages) 4 messages, 3 authors, last reply 2021-02-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help