From nobody Sun Dec 14 06:15:46 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D3A7C00140 for ; Mon, 15 Aug 2022 19:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245120AbiHOTak (ORCPT ); Mon, 15 Aug 2022 15:30:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343899AbiHOT0R (ORCPT ); Mon, 15 Aug 2022 15:26:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D27A6373; Mon, 15 Aug 2022 11:41:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CE03260FB8; Mon, 15 Aug 2022 18:41:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE70EC433D7; Mon, 15 Aug 2022 18:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588911; bh=KG7BALg1sD0ROWmjsKGTkVQvs7DVZVNMvsof7QwVH8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=saW0VZP7GyLal6Yxek+Fi8HbJmMq3eZTwezN8S2EsF+HukbfIa4zTtJgodNWTC0lI v88dz90OZH7uubBfYEWSOofXLpN1Y7iHWIbfG5CUa41OzoB+olejvZyyQe/puLBmFa +j9ARGvkGSKFzJlg591AEuOi3EYYp0hdDQSzpnkw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Daniel Wagner , Kanchan Joshi , Sasha Levin Subject: [PATCH 5.15 552/779] nvme: dont return an error from nvme_configure_metadata Date: Mon, 15 Aug 2022 20:03:16 +0200 Message-Id: <20220815180400.932327480@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Christoph Hellwig [ Upstream commit 363f6368603743072e5f318c668c632bccb097a3 ] When a fabrics controller claims to support an invalidate metadata configuration we already warn and disable metadata support. No need to also return an error during revalidation. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Daniel Wagner Tested-by: Kanchan Joshi Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index d9aea6c22f52..ddaad05ff043 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1719,7 +1719,7 @@ static int nvme_setup_streams_ns(struct nvme_ctrl *ct= rl, struct nvme_ns *ns, return 0; } =20 -static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *= id) +static void nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns = *id) { struct nvme_ctrl *ctrl =3D ns->ctrl; =20 @@ -1735,7 +1735,8 @@ static int nvme_configure_metadata(struct nvme_ns *ns= , struct nvme_id_ns *id) =20 ns->features &=3D ~(NVME_NS_METADATA_SUPPORTED | NVME_NS_EXT_LBAS); if (!ns->ms || !(ctrl->ops->flags & NVME_F_METADATA_SUPPORTED)) - return 0; + return; + if (ctrl->ops->flags & NVME_F_FABRICS) { /* * The NVMe over Fabrics specification only supports metadata as @@ -1743,7 +1744,7 @@ static int nvme_configure_metadata(struct nvme_ns *ns= , struct nvme_id_ns *id) * remap the separate metadata buffer from the block layer. */ if (WARN_ON_ONCE(!(id->flbas & NVME_NS_FLBAS_META_EXT))) - return -EINVAL; + return; =20 ns->features |=3D NVME_NS_EXT_LBAS; =20 @@ -1770,8 +1771,6 @@ static int nvme_configure_metadata(struct nvme_ns *ns= , struct nvme_id_ns *id) else ns->features |=3D NVME_NS_METADATA_SUPPORTED; } - - return 0; } =20 static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, @@ -1909,9 +1908,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, st= ruct nvme_id_ns *id) ns->lba_shift =3D id->lbaf[lbaf].ds; nvme_set_queue_limits(ns->ctrl, ns->queue); =20 - ret =3D nvme_configure_metadata(ns, id); - if (ret) - goto out_unfreeze; + nvme_configure_metadata(ns, id); nvme_set_chunk_sectors(ns, id); nvme_update_disk_info(ns->disk, ns, id); =20 --=20 2.35.1