From nobody Thu Dec 18 05:19:48 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 6CAB2C77B75 for ; Tue, 18 Apr 2023 13:02:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbjDRNCe (ORCPT ); Tue, 18 Apr 2023 09:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232329AbjDRNCW (ORCPT ); Tue, 18 Apr 2023 09:02:22 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB1673581; Tue, 18 Apr 2023 06:02:12 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 23EB71F8D5; Tue, 18 Apr 2023 13:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1681822931; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5g2m9cdhDFuckoCqEKdoJuXLXK61genfhZXKo2FvJPM=; b=lc1/ke99ZqNTootV2UfmpxNzV5L/dqCzxEu2E/KslbltKBcQqpu/J+JzXvDKdUDRFEfXFO 9NRMvGzSWM4nwIEyFA2cwsqLEhb+voC45PGEk8K+PhFpZteYuImCpYLQrS4fESQ7cTacRE I6jW3JTVYwDiENs+OgbFXOZqPaD8fqk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1681822931; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5g2m9cdhDFuckoCqEKdoJuXLXK61genfhZXKo2FvJPM=; b=YZYmCE5dO+lD/Uw9acR0E8Bgo4py4Uli0L+em/DUjLlbgdz/RTVlZsjRTCWfmRwZwtuf12 6h0mBsmUdG4ce6Aw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 14A99139CC; Tue, 18 Apr 2023 13:02:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oC4HBdOUPmSKJwAAMHmgww (envelope-from ); Tue, 18 Apr 2023 13:02:11 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Sagi Grimberg , James Smart , Chaitanya Kulkarni , Martin Belanger , Shinichiro Kawasaki , Daniel Wagner Subject: [PATCH v3 2/4] nvmet-fcloop: Do not wait on completion when unregister fails Date: Tue, 18 Apr 2023 15:01:57 +0200 Message-Id: <20230418130159.11075-3-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418130159.11075-1-dwagner@suse.de> References: <20230418130159.11075-1-dwagner@suse.de> 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" The nvme_fc_unregister_localport() returns an error code in case that the locaport pointer is NULL or has already been unegisterd. localport is is either in the ONLINE state (all resources allocated) or has already been put into DELETED state. In this case we will never receive an wakeup call and thus any caller will hang, e.g. module unload. Signed-off-by: Daniel Wagner --- drivers/nvme/target/fcloop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c index 629a90fe4306..57b2d47cf640 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c @@ -1163,7 +1163,8 @@ __wait_localport_unreg(struct fcloop_lport *lport) =20 ret =3D nvme_fc_unregister_localport(lport->localport); =20 - wait_for_completion(&lport->unreg_done); + if (!ret) + wait_for_completion(&lport->unreg_done); =20 kfree(lport); =20 --=20 2.40.0