]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
block: Change blk_stack_atomic_writes_limits() unit_min check
authorJohn Garry <john.g.garry@oracle.com>
Thu, 9 Jan 2025 11:40:00 +0000 (11:40 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 15 Jan 2025 16:47:43 +0000 (09:47 -0700)
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 <hch@lst.de>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20250109114000.2299896-3-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c

index c2b99262db26cfd86c4ece182c1a9a9edcf513c3..c8368ee8de2ec28561887e8747bc69705097e420 100644 (file)
@@ -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))