Skip to content

Commit d2a9b5f

Browse files
damien-lemoalaxboe
authored andcommitted
nvmet: zns: Do not reference the gendisk conv_zones_bitmap
The gendisk conventional zone bitmap is going away. So to check for the presence of conventional zones on a zoned target device, always use report zones. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Tested-by: Hans Holmberg <hans.holmberg@wdc.com> Tested-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20240408014128.205141-19-dlemoal@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent f4f8458 commit d2a9b5f

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

drivers/nvme/target/zns.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,10 @@ bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
5252
if (get_capacity(bd_disk) & (bdev_zone_sectors(ns->bdev) - 1))
5353
return false;
5454
/*
55-
* ZNS does not define a conventional zone type. If the underlying
56-
* device has a bitmap set indicating the existence of conventional
57-
* zones, reject the device. Otherwise, use report zones to detect if
58-
* the device has conventional zones.
55+
* ZNS does not define a conventional zone type. Use report zones
56+
* to detect if the device has conventional zones and reject it if
57+
* it does.
5958
*/
60-
if (ns->bdev->bd_disk->conv_zones_bitmap)
61-
return false;
62-
6359
ret = blkdev_report_zones(ns->bdev, 0, bdev_nr_zones(ns->bdev),
6460
validate_conv_zones_cb, NULL);
6561
if (ret < 0)

0 commit comments

Comments
 (0)