[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220920091119.115879-11-p.raghav@samsung.com>
Date: Tue, 20 Sep 2022 11:11:16 +0200
From: Pankaj Raghav <p.raghav@...sung.com>
To: agk@...hat.com, snitzer@...nel.org, axboe@...nel.dk,
damien.lemoal@...nsource.wdc.com, hch@....de
Cc: gost.dev@...sung.com, jaegeuk@...nel.org,
Johannes.Thumshirn@....com, hare@...e.de, bvanassche@....org,
dm-devel@...hat.com, matias.bjorling@....com,
linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
pankydev8@...il.com, linux-block@...r.kernel.org,
Pankaj Raghav <p.raghav@...sung.com>,
Johannes Thumshirn <johannes.thumshirn@....com>
Subject: [PATCH v14 10/13] 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 <p.raghav@...sung.com>
Reviewed-by: Bart Van Assche <bvanassche@....org>
Reviewed-by: Damien Le Moal <damien.lemoal@...nsource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@....com>
Reviewed-by: Mike Snitzer <snitzer@...nel.org>
---
drivers/md/dm-table.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index e42016359a77..38b83c383e8f 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -250,7 +250,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 (start & (zone_sectors - 1)) {
+ if (!bdev_is_zone_start(bdev, start)) {
DMERR("%s: start=%llu not aligned to h/w zone size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)start,
@@ -267,7 +267,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 (len & (zone_sectors - 1)) {
+ if (!bdev_is_zone_start(bdev, len)) {
DMERR("%s: len=%llu not aligned to h/w zone size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)len,
@@ -1647,8 +1647,7 @@ static int validate_hardware_zoned_model(struct dm_table *t,
return -EINVAL;
}
- /* 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(t, device_not_matches_zone_sectors, &zone_sectors)) {
--
2.25.1
Powered by blists - more mailing lists