Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7828255rwd; Tue, 20 Jun 2023 06:50:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7z0Fi9QouIN04qjaXuHEVM/2lbCarmZNobqKt/ZiJQAN2/2BfyTGfQ6i8ZPjoyUuu9rFgB X-Received: by 2002:a05:6a20:429f:b0:122:24ed:f77e with SMTP id o31-20020a056a20429f00b0012224edf77emr5096652pzj.33.1687269032170; Tue, 20 Jun 2023 06:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687269032; cv=none; d=google.com; s=arc-20160816; b=fQ2FDbFRvIHyum8Oj3v0Abz3bw0IgN5AFhfsjQXGqO9yfjAazgQIl85EwXiRoXSw1+ 1WjiJQhITEzTL+CikKq3YUZfT32HOkG5+tGExr0qL7Bj4VgEhAQFXWC03K5KrxYtytjW L0mcxtqGOKCWyBmUUImSMhMS4x8zwm06fuY9Wsc8N4UBA1ZdR/n1keTjKwCigii/lDqg QbyvHsgjSpw2I9LiHoEFYmY2Ssq9SEkF24QV1sgWoQ0zoLfCuFxVfYeSPi0EcPsGxYuD 7CuGrMBVMWsPqRcJDr2/oXX76q4a9xbkJ/EurDGcuy1K851lTGuHJh068I8PX4SnFsuX DiIQ== 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=AoMZL1WwymTBvZ61qjY9sbo9USVmC0X8xg8UjUonl4A=; b=xC119/FRslBUTeQBQETibgvwtS204knqZsRm3py3mXm0dSyN3rTCioabC9rJbjHVj8 +6rqhwPrxPvL5a1lhzuqWhvjc3okJza4EcF5SNH6w2+EwfEjPByZTa+lCikefoDertok sXtwWxUdwms19qR4E+jNHLY4fmkYjdlxmQADuXln7Go8HDu+RXBD03wvHOb5FGZY03hW GlmEqXGBG3mBXMRLJgyHEQr13Mc+I1ldJjB3/zXH4ihCIuwJ4JsXvaMjKnUbM7XFFJum uvg4WFwKse4kwwEwi5fjOd1p/LSU91aUOWYk2q3wMFd5OIx9DLZAeeMDj4+krspZ17yR zk1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OWTGwb5P; 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 f18-20020aa79d92000000b00668806fdf46si1712463pfq.390.2023.06.20.06.50.19; Tue, 20 Jun 2023 06:50:32 -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=OWTGwb5P; 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 S233046AbjFTNhb (ORCPT + 99 others); Tue, 20 Jun 2023 09:37:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232341AbjFTNhX (ORCPT ); Tue, 20 Jun 2023 09:37:23 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E45DB10CE; Tue, 20 Jun 2023 06:37:21 -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 940AF2188D; Tue, 20 Jun 2023 13:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687268240; 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=AoMZL1WwymTBvZ61qjY9sbo9USVmC0X8xg8UjUonl4A=; b=OWTGwb5PmWPvgTs4ihl8fxMWI///A36cKf5WeAbNCu601m4vN0ldARu/BQ//QLziAwcz8t h/N8W//yPtvTrgAdLpVGh6N2SPD4vHBl4Hd6LD2ZOuqme0BgGI5FVdiehP32Oz5yMoMUBU U0RdAAFFQoO4e8OTinYK57Khx1G0nHA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687268240; 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=AoMZL1WwymTBvZ61qjY9sbo9USVmC0X8xg8UjUonl4A=; b=FRb75r7X5FkD0FMF6W6slG8sF33HBMQnQ8dRsLZWrfSlyAZERWF98Jx4wPvs8AR38PLwHG eDbZcwDtcWnmWTAQ== 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 853CF133A9; Tue, 20 Jun 2023 13:37:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id z4BIIJCrkWTCPQAAMHmgww (envelope-from ); Tue, 20 Jun 2023 13:37:20 +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 , James Smart , Daniel Wagner Subject: [PATCH v2 3/5] nvmet-fcloop: Remove remote port from list when unlinking Date: Tue, 20 Jun 2023 15:37:09 +0200 Message-ID: <20230620133711.22840-4-dwagner@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230620133711.22840-1-dwagner@suse.de> References: <20230620133711.22840-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 4b35bdcac185..9f7530147893 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c @@ -995,11 +995,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); } @@ -1357,6 +1352,8 @@ __unlink_remote_port(struct fcloop_nport *nport) nport->tport->remoteport = NULL; nport->rport = NULL; + list_del(&nport->nport_list); + return rport; } -- 2.41.0