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

Xixin Liu liuxixin at kylinos.cn
Tue Jun 23 22:53:40 PDT 2026


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




More information about the Linux-nvme mailing list