From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382717; b=G6ByPL+yMKsIovbXEMtqu9t8R82o+9EMWTDMsJCI/0C9i7QoY97T2b2tTqUkuIsQwbC1 TzSts1IfkeZReEIT4LqMTjAOVpecNqj+fycEy5MIZQwOGc2NiMPwOtEJmgEa8F5qIUnSw fWFzA+Jdm6H17GCwaO3kuYb/RkYFVwIIrv5qmXJsD9i/ML7YfYWHnaA9i7p3eloJl21vq jzMmXEYx/6zJ+PJgyOHIKwUsxge/zKfvlyWYwgR3EBuhdMLipYgUtPb2qjb4n9DEQsXB8 vHkTEJZt91dK34fuNR7YbxlGDqHcUOxqsPZpelOiNmu7VSLQLJYhaclJm6EdnEwxIKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382717; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=o2crgiwDaHIVzjGqM74zaYmN9/Nri4ChkHVYNVGH5Aw=; b=hE36lkIpe69Gp7ER2XrtJ4zcTFcJQ0Fi5i+XUEuwy25mM70+Uri0xqhkAMLW9VpP9HOl iF+S5y7qdHgsoK2QE+f2PN5YQQNlnpDiTFLMXCbfj4VL6tPeMj/UhiCBQnlv3HKbLMs+X utuZqnoIJ+DaqDEz1bvVc1sHBw7J9C4iwd9/Di2zFzzuQsYmcgrt3OrZX+czKlyMPjTc5 TPmw6iswUJ2Pspg4Z05kXa9egS4nph9Ho5PHVUpCWAzhbIcQlMwha31dY6dBqLOCcf1OE K3Ju03RI/A1QHTDRNjHRaxCxjBJpUcqjlHu35Co+GHMETKc4x1epOaaLPl7vOCUgmYg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=UVnONqBt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CDAA606A322; Fri, 4 Dec 2026 11:11:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=UVnONqBt Received: by smtp.kernel.org (Postfix) with ESMTPSA id 006AD1F000CE; Fri, 4 Dec 2026 11:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382717; bh=o2crgiwDaHIVzjGqM74zaYmN9/Nri4ChkHVYNVGH5Aw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UVnONqBtjx++OlmLO+J9WQ1PmuT4OmVpWCiUE2WuKL/NDDRHw2l7TLmVJC0++2wxV 5Nv74ssktFhv9tGEJDa1HC205Ktrz4Af9iDQGC5ZOdZRM5+PlX8xqywqq2sFginE7/ skvOEohxiDX8njGyaH4izJB/NFTN8N/9lLINPuHQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shao Mingyin , Keith Busch Subject: [PATCH 6.18 573/703] nvmet: zns: return the namespace lookup error for Identify Date: Fri, 4 Dec 2026 19:07:52 +0900 Message-ID: <20261204100643.007547720@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shao Mingyin commit 687f3014afcd5826fa3d8f40b445f647b5a379b6 upstream. nvmet_execute_identify_ns_zns() jumps to done when nvmet_req_find_ns() fails, and that label overwrites status with a successful copy of the zeroed identify data. An Identify with CNS 05h and CSI 02h for a missing NSID therefore completes with SUCCESS and zeroed data instead of Invalid Namespace. Return the lookup error instead. Fixes: aaf2e048af27 ("nvmet: add ZBD over ZNS backend support") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/target/zns.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/nvme/target/zns.c +++ b/drivers/nvme/target/zns.c @@ -112,7 +112,7 @@ void nvmet_execute_identify_ns_zns(struc status = nvmet_req_find_ns(req); if (status) - goto done; + goto out; if (nvmet_ns_revalidate(req->ns)) { mutex_lock(&req->ns->subsys->lock); @@ -144,7 +144,6 @@ void nvmet_execute_identify_ns_zns(struc mar--; id_zns->mar = cpu_to_le32(mar); -done: status = nvmet_copy_to_sgl(req, 0, id_zns, sizeof(*id_zns)); out: kfree(id_zns);