From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD12A86341 for ; Wed, 24 Jun 2026 05:47:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782280054; cv=none; b=frv9xSSrmONjpykaoqu2IXjBGME8nn2z+fOlcFJO/GwECAo8d58L3O9qAeHIEzP6pPY55mTccBVc0qTO5GUHjS9XYAoOtZruM4DXFiydSXfQTKs9rxg7ffTy7r3pavAAJGIgmoOlHQjeiS6f4ZiBxoyjgaOYhzZ5qVfUVuIpR6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782280054; c=relaxed/simple; bh=508C53DI2s2HoNQPaDkcbL52ghTH47RnS/Gpxh+itQ8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JolTuC289fnnGW5ViZ98YIXzIw/MDw0Pvkik1Qq9r+NE3Pq21Eng0xhMdpmy3AXX7Z0/OuluG8g+jZ6ZnICMTXwuxIC2Ru8cBXoqJxo8fr/NX22T5HkEFHJKWiYBqUbBgQSOgYPImkGcbH4FoLGneKOfwwxK1sDKQOGgQoFLDYs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 2b67bc906f9011f1aa26b74ffac11d73-20260624 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:63ed823e-78d4-4329-9908-dac20550a3fb,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:e7bac3a,CLOUDID:da51d481b21873dbf0d7783d2afb6243,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|136|865|898,TC:nil,Content:0|15|50,E DM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA :0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 2b67bc906f9011f1aa26b74ffac11d73-20260624 X-User: liuxixin@kylinos.cn Received: from [127.0.1.1] [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1156286716; Wed, 24 Jun 2026 13:47:21 +0800 From: Xixin Liu To: linux-nvme@lists.infradead.org Cc: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, linux-kernel@vger.kernel.org, liuxixin@kylinos.cn Subject: [PATCH v1 0/1] nvme: zns: cap zone report nr_zones by DMA buffer size Date: Tue, 23 Jun 2026 17:35:40 +0800 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: nvme-ecn124/send-local.py 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