Message ID | 20231122224719.4042108-2-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:6f03:b0:164:83eb:24d7 with SMTP id r3csp1549462rwn; Wed, 22 Nov 2023 14:47:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IE074cZeeL2YakMBLOlkmaZNvXmM5JTNbR+a/7YlLXQ6taKmbWVkNfqMJt/WFn8h5uIg0l0 X-Received: by 2002:a17:902:eb8c:b0:1cf:6d5c:6f90 with SMTP id q12-20020a170902eb8c00b001cf6d5c6f90mr5007355plg.56.1700693261345; Wed, 22 Nov 2023 14:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700693261; cv=none; d=google.com; s=arc-20160816; b=gy5FlxO071ffX6QvXJz9AhoajX9qOwdJyxa6kbnzJ35yAMozA/5XkJd01/uCWJFkHL 04ZEiVVwsEKKtLiJcrGx0LEtFzKGUl24Igm2l0MTFGvgZ3N/1byPqxW1E9tCKgmfeKt9 YLWChgxJCQLiYylWG8eD/C+Wd6eBRXNKKgEOo8AJnDJn81DF6yNkeHn75fJLD7M4zgbP DX9rfSLMqaKZDwuQT2u7kij0F1mUlJWZODoJAfcq817SFccqA8AaoZUjy6pIcVX4vxDd A4F+DA3IkY9fei5kaOxsv6s301TrIjaQFihrZj1GjayD63VTUbH9H7N4ctfAyTIcE8c+ 526g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NnRIlJI6Jdmd79h9TxFEwIOw5Gi77BWCazL0INdTA4s=; fh=z9F1xB7Zil5negm71YQkGNSLKveYIL/Zk7w910Ma8Q0=; b=ykMw3BWZ28C6+GVSlbxA8uHsGr6gKPuDSTeNKUxUIj2BMkxqEhl5Li4ufkssiRq84K 3WL87Rj5AFd7ay6SNCeB/XiWXKOCCHlYhDL1GAm+ToKrTSraFFWcDfBH7gJbWSRbv1Wm /pb+LWDM/fK3AwdzH1QLzIWo86qoUPYae5C88lP9MIjNOJV5Qa8COKiL36b7mlBoXVQ8 3BBePhrjQCzucU1UnTX+fO3SrFjF1Oa3wEsb26os9EbvOz/OQQXox11iVFL77ZO0qzWA jhTwsSNATJSzmM7uy/AAX/W44umpROySuyb5RiyaLnvi5044sv4w13a3UB/knWy1gjg/ GIiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o9ASBCAx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o2-20020a170902d4c200b001cc47d6f4absi396696plg.107.2023.11.22.14.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 14:47:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o9ASBCAx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id A8BF4837FA3F; Wed, 22 Nov 2023 14:47:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344415AbjKVWrd (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Wed, 22 Nov 2023 17:47:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231952AbjKVWrc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Nov 2023 17:47:32 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4397712A for <linux-kernel@vger.kernel.org>; Wed, 22 Nov 2023 14:47:29 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B1FDC433C7; Wed, 22 Nov 2023 22:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700693248; bh=zAaMHwAz6fQIMNy0cpFdvF6MYVuva8LCFObd/51W7U4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o9ASBCAxjepYSLCKpUhXqOTcz8HeeVQG9sJv//XEYxWgYrMZO5tnjra4JeXJZ6+xu a/gXdFIsEm9KLJvYS4P2s9yLX4eBX0GTq18NjC/79OAuUSjXqihSeEsuz/jXu/7l+O 0tFo1EYPYxovDTaRaXJ5hNqWdN9ds0cEd0FFzGRuRPtuAormWPk2aUDiRE2EGCl/Zv KEd0NI+TOy59khYiULMv+fT2nLAqhqlNI+YMNS1J3lavvcMwH2/GuitmY6F/VIXS1/ J3HBYsTuW+ZXE/jrw1uyIqBcwjGyv+xEpr8IQ6kAa2z7+F2dvfpcMIezbJtI5h8GWb /h1X7fs6VAVUw== From: Arnd Bergmann <arnd@kernel.org> To: linux-nvme@lists.infradead.org Cc: Arnd Bergmann <arnd@arndb.de>, Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>, Chaitanya Kulkarni <kch@nvidia.com>, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] nvme: target: fix nvme_keyring_id() references Date: Wed, 22 Nov 2023 23:47:17 +0100 Message-Id: <20231122224719.4042108-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231122224719.4042108-1-arnd@kernel.org> References: <20231122224719.4042108-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 14:47:34 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783306137671669112 X-GMAIL-MSGID: 1783306137671669112 |
Series |
nvme link failure fixes
|
|
Commit Message
Arnd Bergmann
Nov. 22, 2023, 10:47 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> In configurations without CONFIG_NVME_TARGET_TCP_TLS, the keyring code might not be available, or using it will result in a runtime failure: x86_64-linux-ld: vmlinux.o: in function `nvmet_ports_make': configfs.c:(.text+0x100a211): undefined reference to `nvme_keyring_id' Add a check to ensure we only check the keyring if there is a chance of it being used, which avoids both the runtime and link-time problems. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/nvme/target/configfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index 9eed6e6765ea..e307a044b1a1 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme/target/configfs.c @@ -1893,7 +1893,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group, return ERR_PTR(-ENOMEM); } - if (nvme_keyring_id()) { + if (IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS) && nvme_keyring_id()) { port->keyring = key_lookup(nvme_keyring_id()); if (IS_ERR(port->keyring)) { pr_warn("NVMe keyring not available, disabling TLS\n");