block: use blk_queue_set_zoned in add_partition()
authorDamien Le Moal <damien.lemoal@wdc.com>
Thu, 28 Jan 2021 04:47:29 +0000 (13:47 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Feb 2021 14:44:40 +0000 (07:44 -0700)
When changing the zoned model of host-aware zoned block devices, use
blk_queue_set_zoned() instead of directly assigning the gendisk queue
zoned limit.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@edc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/partitions/core.c

index b1cdf88..d609420 100644 (file)
@@ -334,7 +334,7 @@ static struct block_device *add_partition(struct gendisk *disk, int partno,
        case BLK_ZONED_HA:
                pr_info("%s: disabling host aware zoned block device support due to partitions\n",
                        disk->disk_name);
-               disk->queue->limits.zoned = BLK_ZONED_NONE;
+               blk_queue_set_zoned(disk, BLK_ZONED_NONE);
                break;
        case BLK_ZONED_NONE:
                break;