Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5373204rwe; Tue, 18 Apr 2023 06:09:23 -0700 (PDT) X-Google-Smtp-Source: AKy350ZdH7QuKCEZJDZ3l7Gpaz4ztMI5OUlKEibePuqrRTiZz4F6OM+L1JC3X9/tUHkIFjrwNcGE X-Received: by 2002:a05:6a20:5489:b0:f0:110b:bf9b with SMTP id i9-20020a056a20548900b000f0110bbf9bmr7513017pzk.16.1681823362884; Tue, 18 Apr 2023 06:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681823362; cv=none; d=google.com; s=arc-20160816; b=ZMJramBME+keXXUCZVEwE52jgN1dSq8+7KqRwk2WHP9VGRogx0LRk6q5nxfzJBHB+B qDiMPGF6X2QK1hgheycSB/NxeTI1IS2QIcunLoqr61l+HrEQn/xueHnyFP37xjF+cRrB 9sXIaQnaFdexGVGpFnRX7NDL6dPqAXdNjvE651phQrna3IIK0Q12f28KTHBI/lJ5Td8F GNNfIqJXECNBJZl3E1pfTM7Iz4QtbC6wuWRZ7PuCyzHzCkOKMhMCRm4xeOczbicpNrSC oc5U979Vi5iqRgmlJ4kRmGbasFPn0F4grAW9O9e8M0a3eZwkveQaqWMAHlZPqSPBcmZB WPMw== 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=xHvZovTrRuZrCOEGfusLwQUaUkaDOrzb+7eR8e2Rvs8=; b=GwOR+d3b4yv+mV0iLng60hmAd6mC9mmiiaIiWUi0os8DkNU1X/65gawE8ox3dS+SO5 hoSinEKm/Q2t5RzpnutqT19aZ3oJ6PgNIZZhGsZK7azY4+zKP9bZWbjnnKKLQ/CCbPqE qlTc35bp1yP2G03kdwMxK7tmvyCmpZLZ9VfjLy+lYpahFmN0RqTt1VhVIGd/3IXlzi+v tyVOzJqKgvAginVWfDhqvR8SqGmvqFirZLYHM5VwoEZa4mI3Zsm9Og903rij1hLqtzCM Luh2/2xlhbgZPCYfKJUB5uP1szxe3mrzLe7R56VMKQufnvDIukDA39L0RsoZErepv5Mr hA9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="Pth/OjEI"; 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 a4-20020a656544000000b0051b54dcd001si13371179pgw.780.2023.04.18.06.09.10; Tue, 18 Apr 2023 06:09:22 -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="Pth/OjEI"; 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 S232332AbjDRNCY (ORCPT + 99 others); Tue, 18 Apr 2023 09:02:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232318AbjDRNCV (ORCPT ); Tue, 18 Apr 2023 09:02:21 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1AE24492; Tue, 18 Apr 2023 06:02:11 -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 6FA4921986; Tue, 18 Apr 2023 13:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1681822930; 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=xHvZovTrRuZrCOEGfusLwQUaUkaDOrzb+7eR8e2Rvs8=; b=Pth/OjEIF+iAJtaKL48n4fYL7h2eaUVtFj+NqwQjQABxLdzHi4AMN84J4k1Ucqv+7QPnJ1 KiZjqvyrCW9vTEjkytguqTtifeMvKCkMXTzfWwAfz9daooI29T84piBkqb98osw6U69AMr hnU+VGdJ/nxJoDihIPExvvQ/m1uGHbc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1681822930; 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=xHvZovTrRuZrCOEGfusLwQUaUkaDOrzb+7eR8e2Rvs8=; b=+t33Z/TwSQlmtp9hskJC+ufgtV99df5LInSy+WaZ7NPA+LBpG13Y3GcfrfXUKOC2Moh7UM amIqVMbPnzMBSxDg== 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 5EEBB139CC; Tue, 18 Apr 2023 13:02:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ATI7F9KUPmSEJwAAMHmgww (envelope-from ); Tue, 18 Apr 2023 13:02:10 +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 1/4] nvmet-fcloop: Remove remote port from list when unlinking Date: Tue, 18 Apr 2023 15:01:56 +0200 Message-Id: <20230418130159.11075-2-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: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 The remote port is removed too late from fcloop_nports list. Remove it when port is unregistered. This prevents a busy loop in fcloop_exit, because it is possible the remote port is found in the list and thus we will never progress. The kernel log will be spammed with nvme_fcloop: fcloop_exit: Failed deleting remote port nvme_fcloop: fcloop_exit: Failed deleting target port Signed-off-by: Daniel Wagner --- drivers/nvme/target/fcloop.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c index c780af36c1d4..629a90fe4306 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c @@ -997,11 +997,6 @@ fcloop_nport_free(struct kref *ref) { struct fcloop_nport *nport = container_of(ref, struct fcloop_nport, ref); - unsigned long flags; - - spin_lock_irqsave(&fcloop_lock, flags); - list_del(&nport->nport_list); - spin_unlock_irqrestore(&fcloop_lock, flags); kfree(nport); } @@ -1358,6 +1353,8 @@ __unlink_remote_port(struct fcloop_nport *nport) nport->tport->remoteport = NULL; nport->rport = NULL; + list_del(&nport->nport_list); + return rport; } -- 2.40.0