Skip to content

Commit a865562

Browse files
author
Mikulas Patocka
committed
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]
1 parent 77b8e6f commit a865562

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/md/dm-raid.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3813,8 +3813,10 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits)
38133813
struct raid_set *rs = ti->private;
38143814
unsigned int chunk_size_bytes = to_bytes(rs->md.chunk_sectors);
38153815

3816-
limits->io_min = chunk_size_bytes;
3817-
limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs);
3816+
if (chunk_size_bytes) {
3817+
limits->io_min = chunk_size_bytes;
3818+
limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs);
3819+
}
38183820
}
38193821

38203822
static void raid_presuspend(struct dm_target *ti)

0 commit comments

Comments
 (0)