From: John Garry Date: Thu, 9 Jan 2025 11:40:00 +0000 (+0000) Subject: block: Change blk_stack_atomic_writes_limits() unit_min check X-Git-Tag: v6.14-rc1~202^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d1f7ee7f0b6362c9148d500aeebe49b64b64df4;p=thirdparty%2Flinux.git block: Change blk_stack_atomic_writes_limits() unit_min check The current check in blk_stack_atomic_writes_limits() for a bottom device supporting atomic writes is to verify that limit atomic_write_unit_min is non-zero. This would cause a problem for device mapper queue limits calculation. This is because it uses a temporary queue_limits structure to stack the limits, before finally commiting the limits update. The value of atomic_write_unit_min for the temporary queue_limits structure is never evaluated and so cannot be used, so use limit atomic_write_hw_unit_min. Reviewed-by: Christoph Hellwig Signed-off-by: John Garry Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20250109114000.2299896-3-john.g.garry@oracle.com Signed-off-by: Jens Axboe --- diff --git a/block/blk-settings.c b/block/blk-settings.c index c2b99262db26c..c8368ee8de2ec 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -614,7 +614,7 @@ static void blk_stack_atomic_writes_limits(struct queue_limits *t, if (!(t->features & BLK_FEAT_ATOMIC_WRITES_STACKED)) goto unsupported; - if (!b->atomic_write_unit_min) + if (!b->atomic_write_hw_unit_min) goto unsupported; if (!blk_atomic_write_start_sect_aligned(start, b))