Mikulas Patocka 8238b45798 wait_on_bit: add an acquire memory barrier
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>
2022-08-26 09:30:25 -07:00
..
2022-08-14 09:28:54 -07:00
2022-05-26 17:13:43 -07:00
2022-08-08 15:16:29 -07:00
2022-05-25 16:18:27 -07:00
2021-12-02 17:25:21 +09:00
2022-07-28 12:36:35 +02:00
2022-06-02 08:55:01 -07:00
2022-01-11 13:08:21 -08:00
2021-09-08 15:32:35 -07:00
2022-05-23 17:51:12 -07:00
2022-03-15 10:32:44 +01:00
2022-08-05 09:41:12 -07:00
2021-09-08 15:32:34 -07:00
2022-08-02 19:34:45 -07:00
2021-10-14 13:29:18 +02:00
2022-02-25 09:36:06 +01:00
2022-08-06 16:38:17 -07:00
2022-08-03 19:52:08 -07:00