From: John Garry Date: Fri, 11 Jul 2025 10:52:57 +0000 (+0000) Subject: dm-stripe: limit chunk_sectors to the stripe size X-Git-Tag: v6.12.43~367 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc26f6f2e6517bad657485ac2cb697aad6f023d5;p=thirdparty%2Fkernel%2Fstable.git dm-stripe: limit chunk_sectors to the stripe size [ 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 Reviewed-by: Mikulas Patocka Signed-off-by: John Garry Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20250711105258.3135198-6-john.g.garry@oracle.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index 4112071de0be0..c68dc1653cfd1 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -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; }