]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
block: fix stacking of atomic writes when atomics are not supported
authorJohn Garry <john.g.garry@oracle.com>
Mon, 15 Sep 2025 10:34:59 +0000 (10:34 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 16 Sep 2025 18:29:10 +0000 (12:29 -0600)
commitf2d8c5a2f79c28569edf4948b611052253b5e99a
treec0597fb0f783f4af66c5f97c87d67f643a0dac74
parentbfd4037296bd7e1f95394a2e3daf8e3c1796c3b3
block: fix stacking of atomic writes when atomics are not supported

Atomic writes support may not always be possible when stacking devices
which support atomic writes. Such as case is a different atomic write
boundary between stacked devices (which is not supported).

In the case that atomic writes cannot supported, the top device queue HW
limits are set to 0.

However, in blk_stack_atomic_writes_limits(), we detect that we are
stacking the first bottom device by checking the top device
atomic_write_hw_max value == 0. This get confused with the case of atomic
writes not supported, above.

Make the distinction between stacking the first bottom device and no
atomics supported by initializing stacked device atomic_write_hw_max =
UINT_MAX and checking that for stacking the first bottom device.

Fixes: d7f36dc446e8 ("block: Support atomic writes limits for stacked devices")
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c