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=1796381315; b=o1oeekxrjKbAB1l/OuBh1h4KCEjXMO+huwzy1jJAky8MqTnPMwLGOvfHCkz9HB/4n3j7 2gBHIDE/IKC7e8vV4GBeZt6FpI5ADg4FcyRhZLa+wIfWWdlGdznQCpv2bgaguPmW1b1GR 3uXYLs+8EHOUFiiOHDSiR2mLK8ZOJqA/561xLunWv/s3VkxR1+GXIXBdANULr4pkgp+Wu iOqlxBkPgRtrX4dLk5yQaSyV7I2G2ENPv8pzkvc0mH5+9VsOZ9b+g29XfwX5VssIlTlEi Yg8+WHU1vuGmVDT5bd6xHTULcF0L80LXBW0++y8LTFpYnF1WwrTEkhOdnjZbdkNVpaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381315; 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=C+z3AcIVm8orE14YinXHAcFMF5VRD72qt6LIFcd4HIA=; b=33nLCMAbM1jJuBj86TvhkqDSRntnW/ZP7o+LeK+jDlNvEeZskn4h29k0TcyXoEX3S4Mf tky/GJ382AWSSQu5sXrQ0dMkkGno0BGYyBif01G12c7ZtQ0pbbvdhzhu53BeEhG2mIkxv Skjg5wtUdzLAnheNmSbE7wkgd0+6ZI3LVH1TU7yHTMxlvJzdsN2gDg5/3k/JTSNcjzZoL JutATD7/ykOyNKc01YA4avqAgzhyPG32ZjioOEnm3YwG/T/2woZQDfYgmSo6nPvvnnNrg +b3OVw7QoqtIClFcDZgvIU5509cMjISLu1n9a7qu9ooHDwfoRs3pZs03q7sDnErMdMQ== 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=aQlCJlUp; 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 42B24606A322; Fri, 4 Dec 2026 10:48: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=aQlCJlUp Received: by smtp.kernel.org (Postfix) with ESMTPSA id B07E11F000C2; Fri, 4 Dec 2026 10:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381315; bh=C+z3AcIVm8orE14YinXHAcFMF5VRD72qt6LIFcd4HIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aQlCJlUpG55Fhe8/zdbNNd67O7ZmtYl9edaBx9F77ht0C+q/CfQEK2KPlSTobtO/r yg4F92PfBepmeRP8eTnMG1Z1MHzKXF5dH398kHQIs4J/s98d0iKQ4fq/xi4D+w5urM Uxgc6dpGhxEC1zSjq6K5O6Mxm0rswxVvBNPOATOM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shao Mingyin , Keith Busch Subject: [PATCH 7.3 649/742] nvmet: zns: return the namespace lookup error for Identify Date: Fri, 4 Dec 2026 19:08:33 +0900 Message-ID: <20261204100652.330665558@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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 @@ -108,7 +108,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); @@ -140,7 +140,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);