Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5413412rwl; Tue, 11 Apr 2023 05:15:14 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2yUPDP13aiEriF+IgkZr+AvUcekR4DaN8PWP35VxjUdS8oMZ7bIaEMGX6SE/UNRYVZVfL X-Received: by 2002:aa7:cac9:0:b0:502:2382:5c24 with SMTP id l9-20020aa7cac9000000b0050223825c24mr13480887edt.39.1681215314094; Tue, 11 Apr 2023 05:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681215314; cv=none; d=google.com; s=arc-20160816; b=zuKVi1AUMWnP+xK6UUfP6LYtNVWMJ7Sv8HrepvLcBA9IpQgb9CALUrs+Q/zHTI32VK WAON0HmFMMEHMOMtISrPoBjstCLgsfikJ8OykJqbrFQvGi+TVpy6UTASRy3CVipFzAzB NSayG3nAAF4jlVL3IaX49+OGv5BV5e5/dAT0gmllvL9rBtbD/JLk711ZZAHLNlaDL1oW PxIDn6uke6PIqEZizSf3A4tydr4Qg9WhO2zGIe7g8IdgbsvKFMZOA0pC4/Yz/6MaUU3i Qf8wCSXel2gONyxXM2zeLzeo5I1hARHJGcOxGvqdX3u5Jft2Vn/XxDI+Dwk+wbN9CPk4 3r3Q== 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:dkim-signature; bh=AM9IzWlxFgnv2yBc55OQqOy6rxrdVVGUpc9W9P8C1kk=; b=nD9wWWxg7NebBa3fI/R1px6ZTJEjmLskIW3HDfbe4FJHQ4jG9G9oc6ZVn729d+Ut5O FabgSKsklw9S7a4DpJj3wG8VX/wXQHIJRYlIQisSPuUULxCDawo65lC38iYDomamR9Jr z5WyQPlKG2XkrYq2dSNLRjAAT+oSvD12pX5eUrICSQ+2Cfg41B9HPUbJ2K6L8XoIXiQn j1uK1xAjQ6iyURDJtxQVSy1dnWWx2YEMyZOI698oTTi1N6tu81CcHbqdDSdmTM+Xn7uW ssk8QtNbw6KxxDi347BofR9Y72J3DJgKq91WxUiTxf/Amyz7PuV9DGUOVRUSBxRTCBDp lcOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=RCcSRQDD; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020aa7c683000000b00504b12a26c8si3250040edq.74.2023.04.11.05.14.14; Tue, 11 Apr 2023 05:15:14 -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=@suse.de header.s=susede2_rsa header.b=RCcSRQDD; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbjDKMHd (ORCPT + 99 others); Tue, 11 Apr 2023 08:07:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbjDKMH2 (ORCPT ); Tue, 11 Apr 2023 08:07:28 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D36FA2683 for ; Tue, 11 Apr 2023 05:07:27 -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-out1.suse.de (Postfix) with ESMTPS id 8C0EC21A54; Tue, 11 Apr 2023 12:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1681214846; 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=AM9IzWlxFgnv2yBc55OQqOy6rxrdVVGUpc9W9P8C1kk=; b=RCcSRQDDXUpduzhYh4BPlWyt2F+66XGCyV33bTQxIFpZODzNCy5RlSDaFo7PE5VOZ2Knsf zLPFpb4k4+MGfuhnqiPljC4jrat9AgRi/52YhSf8ROdMaE1WJorJKlaq4XTqW9U4o6lKDm rXEysvyuuDD9bu/DYjwOxkoBI526Yy4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1681214846; 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=AM9IzWlxFgnv2yBc55OQqOy6rxrdVVGUpc9W9P8C1kk=; b=mst0K5lD3ygsXLl/DIWPSH8p8XbhhthNeMpFoPLhlYmkYOSrg3R3c3M+n+3FcZyzr3DkAH QdDmmvAcy/5I0OAQ== 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 8053113638; Tue, 11 Apr 2023 12:07:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id L4knH35NNWR7BgAAMHmgww (envelope-from ); Tue, 11 Apr 2023 12:07:26 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Sagi Grimberg , James Smart , Chaitanya Kulkarni , Daniel Wagner Subject: [PATCH v2 2/4] nvmet-fcloop: Do not wait on completion when unregister fails Date: Tue, 11 Apr 2023 14:07:16 +0200 Message-Id: <20230411120718.14477-3-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230411120718.14477-1-dwagner@suse.de> References: <20230411120718.14477-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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 1e53c8fe4b95..6c3905498a94 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c @@ -1162,7 +1162,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.0