[PATCH v7 11/13] dm-table: allow non po2 zoned devices

From: Pankaj Raghav
Date: Wed Jun 15 2022 - 06:21:00 EST


As the block layer now supports non po2 zoned devices, allow dm to
support non po2 zoned device.

Signed-off-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
---
drivers/md/dm-table.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index b553cdb6d..ec77e7830 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -251,7 +251,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
if (bdev_is_zoned(bdev)) {
unsigned int zone_sectors = bdev_zone_sectors(bdev);

- if (blk_queue_is_zone_start(bdev_get_queue(bdev), start)) {
+ if (!blk_queue_is_zone_start(bdev_get_queue(bdev), start)) {
DMWARN("%s: start=%llu not aligned to h/w zone size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)start,
@@ -268,7 +268,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
* devices do not end up with a smaller zone in the middle of
* the sector range.
*/
- if (blk_queue_is_zone_start(bdev_get_queue(bdev), len)) {
+ if (!blk_queue_is_zone_start(bdev_get_queue(bdev), len)) {
DMWARN("%s: len=%llu not aligned to h/w zone size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)len,
@@ -1648,7 +1648,7 @@ static int validate_hardware_zoned_model(struct dm_table *table,
}

/* Check zone size validity and compatibility */
- if (!zone_sectors || !is_power_of_2(zone_sectors))
+ if (!zone_sectors)
return -EINVAL;

if (dm_table_any_dev_attr(table, device_not_matches_zone_sectors, &zone_sectors)) {
--
2.25.1