+4
−4
Loading
mainline inclusion from mainline-v6.0-rc3 commit 8238b457 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT -------------------------------- There are several places in the kernel where wait_on_bit is not followed by a memory barrier (for example, in drivers/md/dm-bufio.c:new_read). On architectures with weak memory ordering, it may happen that memory accesses that follow wait_on_bit are reordered before wait_on_bit and they may return invalid data. Fix this class of bugs by introducing a new function "test_bit_acquire" that works like test_bit, but has acquire memory ordering semantics. Signed-off-by:Mikulas Patocka <mpatocka@redhat.com> Acked-by:
Will Deacon <will@kernel.org> Cc: stable@vger.kernel.org Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org> Conflicts: arch/x86/include/asm/bitops.h include/asm-generic/bitops/non-atomic.h include/asm-generic/bitops/instrumented-non-atomic.h include/asm-generic/bitops/non-instrumented-non-atomic.h include/linux/bitops.h include/linux/buffer_head.h include/asm-generic/bitops/generic-non-atomic.h Documentation/atomic_bitops.txt [Due to the large number of patch modifications and conflicts, patch adaptation is performed in the original contexts] Signed-off-by:
Zizhi Wo <wozizhi@huawei.com> Signed-off-by:
Baokun Li <libaokun1@huawei.com>