Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2883280rwb; Mon, 15 Aug 2022 13:15:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Fczua2rkCHFqU7V6VrHQ3/dmINyqNq5WCnfeM3PpJMh6joqZ13wgCxl0s5xhBm7pZJPrW X-Received: by 2002:a17:907:a06a:b0:730:d10e:fff3 with SMTP id ia10-20020a170907a06a00b00730d10efff3mr11770702ejc.109.1660594528787; Mon, 15 Aug 2022 13:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594528; cv=none; d=google.com; s=arc-20160816; b=ua4V7C5W2YzyXDnHqr9OYvwUayDjQ1gn6Wsjr8JJm/BXw1qhFD9MsV2u8FNDNs7qDJ 4MMpkaH3utGpan232Ovr0wnTOyhHn5+BdQS/BMUCErXiWKBDPIUHKAHvOuNSh5+UC5yv gXpGi8o/cUrExkQfPtllxmoEsLGPnnXkpTYOJ/kNIzmjyAdxO6Y4XZkcHGSkuHHAx1v7 xCZ6xTWyiEjt6A7IzAdnsaJ6JEOx5UrhcJZ0a/75aKbVARP3unrabCCLQoBD/3MtBStk vQuD+sLamXenh69d8fwK7SJvWoRpagjzne//wE2BYl/JZ1eo9oc9BHFCadPuwZoY8oxw QLBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kcYlwVu7e+lyRGV9jQfBliWdkRcTchQA/So5vOy+D5g=; b=F07Avq0cnUFTtgjQG0yEuNjTbczAGSp8PVujfRBBinR9rOZTfLFLp76ZdEtlITOgxp CaQipYLVagiMBggrt7mzkPc1TDZwfw+XaE+uFG9f73/qi/l95GE3LxZawKjWGzaO9qcu qbxm1CvQogHMiVvP7sOeeDwoT2m/mw0ycEAlxVqSwHccfwYBTOsXVQNXl8/3Gs+7pFTt QRzzVZIdmerhi3Orlq7iKX65NfeeegxN4+1RHIXnuZFUIdP2SkOkF8hVMsY6c2b/r3eY HdWUEglPWb8oUgkE9Ge8Dr/IKxC2BEJziooBTH/kEMKbJlBt1PvVV9M6nYSDg8tEva6D OztQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=saW0VZP7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc34-20020a17090716a200b0073832e13344si6719187ejc.86.2022.08.15.13.15.03; Mon, 15 Aug 2022 13:15:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=saW0VZP7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244541AbiHOTah (ORCPT + 99 others); Mon, 15 Aug 2022 15:30:37 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 *ctrl, struct nvme_ns *ns, return 0; } -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 = ns->ctrl; @@ -1735,7 +1735,8 @@ static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id) ns->features &= ~(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; ns->features |= NVME_NS_EXT_LBAS; @@ -1770,8 +1771,6 @@ static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id) else ns->features |= NVME_NS_METADATA_SUPPORTED; } - - return 0; } static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, @@ -1909,9 +1908,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id) ns->lba_shift = id->lbaf[lbaf].ds; nvme_set_queue_limits(ns->ctrl, ns->queue); - ret = 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); -- 2.35.1