]> www.infradead.org Git - users/hch/block.git/commitdiff
nvme: set BLK_FEAT_ZONED for ZNS multipath disks
authorChristoph Hellwig <hch@lst.de>
Thu, 29 Aug 2024 06:05:07 +0000 (09:05 +0300)
committerChristoph Hellwig <hch@lst.de>
Thu, 29 Aug 2024 06:22:51 +0000 (09:22 +0300)
The new stricter limits validation doesn't like a max_append_sectors value
to be set without BLK_FEAT_ZONED.  Set it before allocation the disk to
fix this instead of just inheriting it later.

Fixes: d690cb8ae14b ("block: add an API to atomically update queue limits")
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/multipath.c

index 25761fb7d88ff007201c6ce38e6e2771b9766a74..ac6991ded82a47a843a227b1c27fc7449d555dcd 100644 (file)
@@ -617,7 +617,9 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
        blk_set_stacking_limits(&lim);
        lim.dma_alignment = 3;
        lim.features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL;
-       if (head->ids.csi != NVME_CSI_ZNS)
+       if (head->ids.csi == NVME_CSI_ZNS)
+               lim.features |= BLK_FEAT_ZONED;
+       else
                lim.max_zone_append_sectors = 0;
 
        head->disk = blk_alloc_disk(&lim, ctrl->numa_node);