aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid.c
diff options
context:
space:
mode:
authorMikulas Patocka <[email protected]>2025-09-15 14:12:40 +0000
committerMikulas Patocka <[email protected]>2025-09-17 14:04:29 +0000
commita86556264696b797d94238d99d8284d0d34ed960 (patch)
tree987b99aa3a30f6f94ac5d870f21b8c90906eb644 /drivers/md/dm-raid.c
parentdm-integrity: limit MAX_TAG_SIZE to 255 (diff)
downloadkernel-a86556264696b797d94238d99d8284d0d34ed960.tar.gz
kernel-a86556264696b797d94238d99d8284d0d34ed960.zip
dm-raid: don't set io_min and io_opt for raid1
These commands modprobe brd rd_size=1048576 vgcreate vg /dev/ram* lvcreate -m4 -L10 -n lv vg trigger the following warnings: device-mapper: table: 252:10: adding target device (start sect 0 len 24576) caused an alignment inconsistency device-mapper: table: 252:10: adding target device (start sect 0 len 24576) caused an alignment inconsistency The warnings are caused by the fact that io_min is 512 and physical block size is 4096. If there's chunk-less raid, such as raid1, io_min shouldn't be set to zero because it would be raised to 512 and it would trigger the warning. Signed-off-by: Mikulas Patocka <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Cc: [email protected]
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r--drivers/md/dm-raid.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 79ea85d18e24..f4b904e24328 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3813,8 +3813,10 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits)
struct raid_set *rs = ti->private;
unsigned int chunk_size_bytes = to_bytes(rs->md.chunk_sectors);
- limits->io_min = chunk_size_bytes;
- limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs);
+ if (chunk_size_bytes) {
+ limits->io_min = chunk_size_bytes;
+ limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs);
+ }
}
static void raid_presuspend(struct dm_target *ti)