[PATCH v1 0/1] nvme: zns: cap zone report nr_zones by DMA buffer size

From: Xixin Liu

Date: Wed Jun 24 2026 - 01:54:17 EST


Hi,

The ZNS host driver issues Zone Management Receive with Partial Report
(PR=1) fixed. The Number of Zones (NZ) field in the report header must
reflect the zone descriptors actually transferred in the DMA buffer (ZNS
Command Set Specification Rev 1.2, section 3.4.2).

nvme_ns_report_zones() caps the parse loop by the device-reported NZ and
the caller's nr_zones limit, but not by the number of descriptors that fit
in buflen. Cap nz with min3(device NZ, nr_zones - zone_idx, max_in_buf).

Thanks,
Xixin Liu

---

Xixin Liu (1):
nvme: zns: cap zone report nr_zones by DMA buffer size

drivers/nvme/host/zns.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

--
2.43.0