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 D57BF326927 for ; Wed, 24 Jun 2026 05:54:05 +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=1782280447; cv=none; b=fVsgDxxsiNgVW/1wsFVg6wi52o48Ee/lJFAZcGjOMRCDo4UFsLnkkligZo6EDePcgmXJJAVLQzFx9XHi9VXb9fU0hC8n6ii1j43UTx7MWCcMc6rNpDhox3QodisR5nVImHdiBmJ2l2hsauXysakuCrojcVSp5Zfqsi8HZOM1Ivs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782280447; c=relaxed/simple; bh=508C53DI2s2HoNQPaDkcbL52ghTH47RnS/Gpxh+itQ8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=no8Kehj1sWgDo44Hi9mUpPyE/xjsO9qRZcYy8Y4z2kjbXDMwTS9GYY+4+DBzfxAe++bjC6zYKZPhOOFHznJQgSNPpWAyu73v6S2GQMZNYO5fayWVADbgekWUIAGZKYyAl1wFP9I+vAOy65rUXrITm0tGswWT0yLKOwoMycuMy7Y= 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: 170757aa6f9111f1aa26b74ffac11d73-20260624 X-CID-CACHE: Type:Local,Time:202606241347+08,HitQuantity:1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:c60e2776-d322-4ade-a4a2-13a6b604109d,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: 170757aa6f9111f1aa26b74ffac11d73-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 1126859520; Wed, 24 Jun 2026 13:53:57 +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: Wed, 24 Jun 2026 13:53: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