From mboxrd@z Thu Jan 1 00:00:00 1970 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 AAE8EC7EE2F for ; Tue, 6 Jun 2023 12:24:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236713AbjFFMY2 (ORCPT ); Tue, 6 Jun 2023 08:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232356AbjFFMYZ (ORCPT ); Tue, 6 Jun 2023 08:24:25 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD7D010C7; Tue, 6 Jun 2023 05:24:24 -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 5A2321FD69; Tue, 6 Jun 2023 12:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686054263; 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=wb/zjNGR8vZ6lz2lsTJaQdU6G03xji6YZEjNm9p9xpM=; b=XbRAzKIk+8BwZMJqCTkROBCnYCApL5tn3HVK3mLxE01nMJ13uoOtRVNt7R452KNNNUiXNz CP85SeKxXqHb1GIMAWU+Z+jF8oTf/FjHldEzmA42cnXvMU7brPyiAX8CgoWEwLy7uIHc8Z g8jX2KkCSzVJTw+ufERjCA4U8dZe84k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686054263; 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=wb/zjNGR8vZ6lz2lsTJaQdU6G03xji6YZEjNm9p9xpM=; b=cqVAqDwKfn7FglB6pJlPli5dVhc49ugHt/54UYqQV+sO+PsyKWwb/p5I0iUShcsrNtIjaU iUVuONkOQcHmTWBg== 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 4CA9E13519; Tue, 6 Jun 2023 12:24:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Rw6PEnclf2SDOAAAMHmgww (envelope-from ); Tue, 06 Jun 2023 12:24:23 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Sagi Grimberg , Hannes Reinecke , Daniel Wagner Subject: [PATCH v4 1/1] nvmet-fcloop: Do not wait on completion when unregister fails Date: Tue, 6 Jun 2023 14:24:11 +0200 Message-Id: <20230606122411.7972-2-dwagner@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606122411.7972-1-dwagner@suse.de> References: <20230606122411.7972-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 1ab3d900f2bf..c65a73433c05 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c @@ -1166,7 +1166,8 @@ __wait_localport_unreg(struct fcloop_lport *lport) ret = nvme_fc_unregister_localport(lport->localport); - wait_for_completion(&lport->unreg_done); + if (!ret) + wait_for_completion(&lport->unreg_done); kfree(lport); -- 2.40.1