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=1796384076; b=Rc8wHNLYxGLt+Fz103bQ5a1fZHX+i3nCuFGYgwChy2/cGrN8VuLYe19gzjTK6y8LRFou wHqv7ujAf7UX8TQXdgJ5wTG7KFANpw9bqKs7TqCt+YGElqf0R5e9rnsXQn8i9tU1RbKWS UMbCrNNxJsI7gGNwQzXTVfYJ0Uimo3Mk9WTnv9+blsyvrZ6OweU18pQZyxDAmRS9pja6J AJPF9hopwVHtgYfUIFm4XKLqta10/mnAiam/PP3aIPo32FL6p8HfTtjVhMlZzmauBP4ZD KgnX6TsWAToepVwAIipuLDYizAuwmTTbarwSwV8b9XdqoHP7QQwOAyF+e5xao6Nl5VA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384076; 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=T542He+BzM4xmVmeKUz3w+1hxGSgjBQdB3dTBS4oAX4=; b=JRyJ16YQy/sZfGm9riNLZt0Nd9l4RWJrs/Shw7iLclyNBOk33jrgNWRYZMuo6o4Fi/3d f0tMSsq+SBpaKK9w3pS4bKT+zNHMgCtXyC6bF1PmJtnuEaWj1mlQKJq6BdLGB37fVdD/3 Ore+1nCgtRH7qIvyKrOt+maHacYVF69oGdj3w9aYJKyHhOIcerGpGj31AZByjwEul9fzt PEnvC2cgpCeQQisX/ldbuJcqQvHuLRfN9pFZEQnWPuhWjFnNuOy17sNySO9VUv7kSfUZU jezA1Zv+AdI8/eZ5ihA/GHZEzACL/0kgOy5qw+/ryz98fWHWpcIQUSVHdzShIbAtd6w== 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=miwIgsUo; 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 E46E8606A322; Fri, 4 Dec 2026 11:34:35 +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=miwIgsUo Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6089E1F000C2; Fri, 4 Dec 2026 11:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384075; bh=T542He+BzM4xmVmeKUz3w+1hxGSgjBQdB3dTBS4oAX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=miwIgsUoKQSYA2kcEIhAVnZaWnjJPg4UKakptSoYHQtnUsYz2FM/G0lsS8uc80Gfr /r/ReU/H8zYvQaRaa1Okntso6fuWRE+Jlf89iNvPFfu3o4LjbPoMcJYVOh1VCsoccz TlbWc0eYuF08HryfT3xLbDTVgn9Btx4sluOw4B80= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shao Mingyin , Keith Busch Subject: [PATCH 6.12 485/555] nvmet: zns: return the namespace lookup error for Identify Date: Fri, 4 Dec 2026 19:08:48 +0900 Message-ID: <20261204100627.599892968@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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);