Skip to contentSkip to conversation

nvme: set BLK_FEAT_ZONED for ZNS multipath disks

PATCH Applied Christoph Hellwig 2 participants 2 messages Aug 29, 2024 – Sep 3, 2024 NVMe

lore
Share & tools
lore

Christoph Hellwig

author maintainer
#0 lore raw

PATCH 1/1 nvme: set BLK_FEAT_ZONED for ZNS multipath disks

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")
---
 drivers/nvme/host/multipath.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nvme/host/multipath.c +3 -1
index 25761fb7d88ff0..ac6991ded82a47 100644
@@ -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);
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 5 lines · Christoph Hellwig

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")

Applied to nvme-6.11, thanks.