Skip to content

Commit

Permalink
nvme: set BLK_FEAT_ZONED for ZNS multipath disks
Browse files Browse the repository at this point in the history
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: d690cb8 ("block: add an API to atomically update queue limits")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
  • Loading branch information
Christoph Hellwig authored and Keith Busch committed Sep 3, 2024
1 parent 61aa894 commit 28982ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nvme/host/multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,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);
Expand Down

0 comments on commit 28982ad

Please sign in to comment.