nvmet: zns: Do not reference the gendisk conv_zones_bitmap
authorDamien Le Moal <dlemoal@kernel.org>
Mon, 8 Apr 2024 01:41:18 +0000 (10:41 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 17 Apr 2024 14:44:03 +0000 (08:44 -0600)
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>
drivers/nvme/target/zns.c

index 3148d9f1bde66ac44d114b71f45c98ab52a6ed24..0021d06041c1e5ac3d1b3ac51cc2e974c5ce87d5 100644 (file)
@@ -52,14 +52,10 @@ bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
        if (get_capacity(bd_disk) & (bdev_zone_sectors(ns->bdev) - 1))
                return false;
        /*
-        * ZNS does not define a conventional zone type. If the underlying
-        * device has a bitmap set indicating the existence of conventional
-        * zones, reject the device. Otherwise, use report zones to detect if
-        * the device has conventional zones.
+        * ZNS does not define a conventional zone type. Use report zones
+        * to detect if the device has conventional zones and reject it if
+        * it does.
         */
-       if (ns->bdev->bd_disk->conv_zones_bitmap)
-               return false;
-
        ret = blkdev_report_zones(ns->bdev, 0, bdev_nr_zones(ns->bdev),
                                  validate_conv_zones_cb, NULL);
        if (ret < 0)