block: Treat sequential write preferred zone type as invalid
authorDamien Le Moal <dlemoal@kernel.org>
Sun, 7 Jan 2024 07:22:12 +0000 (16:22 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 8 Jan 2024 15:34:24 +0000 (08:34 -0700)
With the removal of the support for host-aware zoned devices,
blk_revalidate_zone_cb() should never see the zone type
BLK_ZONE_TYPE_SEQWRITE_PREF (sequential write preffered zones). Treat
this zone type as being invalid.

Fixes: 7437bb73f087 ("block: remove support for the host aware zone model")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240107072212.1071080-1-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-zoned.c

index 623879d875a43f2ccf5840fe63bc6a960da9b7f6..d343e5756a9c8048374edcce8000230eed10480b 100644 (file)
@@ -498,7 +498,6 @@ static int blk_revalidate_zone_cb(struct blk_zone *zone, unsigned int idx,
                set_bit(idx, args->conv_zones_bitmap);
                break;
        case BLK_ZONE_TYPE_SEQWRITE_REQ:
-       case BLK_ZONE_TYPE_SEQWRITE_PREF:
                if (!args->seq_zones_wlock) {
                        args->seq_zones_wlock =
                                blk_alloc_zone_bitmap(q->node, args->nr_zones);
@@ -506,6 +505,7 @@ static int blk_revalidate_zone_cb(struct blk_zone *zone, unsigned int idx,
                                return -ENOMEM;
                }
                break;
+       case BLK_ZONE_TYPE_SEQWRITE_PREF:
        default:
                pr_warn("%s: Invalid zone type 0x%x at sectors %llu\n",
                        disk->disk_name, (int)zone->type, zone->start);