]> git.baikalelectronics.ru Git - kernel.git/commit
dm: fix dm_io and dm_target_io flags race condition on Alpha
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 28 Mar 2022 16:34:31 +0000 (12:34 -0400)
committerMike Snitzer <snitzer@kernel.org>
Fri, 1 Apr 2022 17:19:27 +0000 (13:19 -0400)
commit96f94cbd10ed244a3ada91a8d31b67303aa47e1b
tree5d8699cc392668209a04c5d69da17f91ba67fd41
parent6e2609ffdfe6bcbc49583663c0bec79c15633cc3
dm: fix dm_io and dm_target_io flags race condition on Alpha

Early alpha processors cannot write a single byte or short; they read 8
bytes, modify the value in registers and write back 8 bytes.

This could cause race condition in the structure dm_io - if the fields
flags and io_count are modified simultaneously.

Fix this bug by using 32-bit flags if we are on Alpha and if we are
compiling for a processor that doesn't have the byte-word-extension.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 72f84c9bfbd6 ("dm: reduce size of dm_io and dm_target_io structs")
[snitzer: Jens allowed this change since Mikulas owns a relevant Alpha!]
Acked-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-core.h
include/linux/blk_types.h