diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2022-10-18 17:06:45 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-10-18 19:38:16 +0300 |
commit | 141b3523e9be6f15577acf4bbc3bc1f82d81d6d1 (patch) | |
tree | 66e3b3ea3e39a1d3f818d4de600e5e2546eb9bf3 /drivers/md/dm-stats.c | |
parent | bb1a1146467ad812bb65440696df0782e2bc63c8 (diff) | |
download | linux-141b3523e9be6f15577acf4bbc3bc1f82d81d6d1.tar.xz |
dm bufio: use the acquire memory barrier when testing for B_READING
The function test_bit doesn't provide any memory barrier. It may be
possible that the read requests that follow test_bit(B_READING, &b->state)
are reordered before the test, reading invalid data that existed before
B_READING was cleared.
Fix this bug by changing test_bit to test_bit_acquire. This is
particularly important on arches with weak(er) memory ordering
(e.g. arm64).
Depends-On: 8238b4579866 ("wait_on_bit: add an acquire memory barrier")
Depends-On: d6ffe6067a54 ("provide arch_test_bit_acquire for architectures that define test_bit")
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-stats.c')
0 files changed, 0 insertions, 0 deletions