Skip to content

nvme: zns: cap zone report nr_zones by DMA buffer size

Xixin Liu linux-nvme lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1nvme: zns: cap zone report nr_zones by DMA buffer sizedrivers/nvme/host/zns.c+8 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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(-)
Signature · 1 line
2.43.0