From 355dfccf9d07594019461e31f547fffa56f72e9a Mon Sep 17 00:00:00 2001
From: Pankaj Raghav
Date: Fri, 23 Sep 2022 19:36:15 +0200
Subject: [PATCH] ANDROID: dm-table: allow zoned devices with non power-of-2
zone sizes
Allow dm to support zoned devices with non power-of-2(po2) zone sizes as
the block layer now supports it.
Signed-off-by: Pankaj Raghav
Bug: 197782466
Bug: 269471019
Bug: 415836627
Link: https://lore.kernel.org/linux-block/20220923173618.6899-11-p.raghav@samsung.com/
Change-Id: I837811b17aacecc74fc2fd9d4009ad7e66917fb8
[ bvanassche: rebased on top of kernel android16-6.12 ]
Signed-off-by: Bart Van Assche
---
drivers/md/dm-table.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5db7143a17cc..c70b1ba1c6ad 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1640,8 +1640,8 @@ static int validate_hardware_zoned(struct dm_table *t, bool zoned,
return -EINVAL;
}
- /* Check zone size validity and compatibility */
- if (!zone_sectors || !is_power_of_2(zone_sectors))
+ /* Check zone size validity. */
+ if (!zone_sectors)
return -EINVAL;
if (dm_table_any_dev_attr(t, device_not_matches_zone_sectors, &zone_sectors)) {