]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dm-stripe: limit chunk_sectors to the stripe size
authorJohn Garry <john.g.garry@oracle.com>
Fri, 11 Jul 2025 10:52:57 +0000 (10:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:30:19 +0000 (18:30 +0200)
[ Upstream commit 5fb9d4341b782a80eefa0dc1664d131ac3c8885d ]

Same as done for raid0, set chunk_sectors limit to appropriately set the
atomic write size limit.

Setting chunk_sectors limit in this way overrides the stacked limit
already calculated based on the bottom device limits. This is ok, as
when any bios are sent to the bottom devices, the block layer will still
respect the bottom device chunk_sectors.

Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
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/20250711105258.3135198-6-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-stripe.c

index 4112071de0be0c17d70ad10b0da237bd825f1df9..c68dc1653cfd1b27b2a3afe731d062298e7ef3e6 100644 (file)
@@ -459,6 +459,7 @@ static void stripe_io_hints(struct dm_target *ti,
        struct stripe_c *sc = ti->private;
        unsigned int chunk_size = sc->chunk_size << SECTOR_SHIFT;
 
+       limits->chunk_sectors = sc->chunk_size;
        limits->io_min = chunk_size;
        limits->io_opt = chunk_size * sc->stripes;
 }