Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp22930rdb; Mon, 18 Dec 2023 07:58:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/zKZFVMIT1/pX7tuEfo1LYfAoo/YuXDAXQxzhXUkGdLTz6ZsNDPWehKcICeQkAslsTGfo X-Received: by 2002:a17:906:159:b0:a22:ef8b:76c8 with SMTP id 25-20020a170906015900b00a22ef8b76c8mr4830102ejh.134.1702915134730; Mon, 18 Dec 2023 07:58:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702915134; cv=none; d=google.com; s=arc-20160816; b=Cg3/EsPr092GB1dA+stnc8VKZyuCOObwmlpPWQXcAouSbhKFX8XFEikZi+n+PIHUoZ sjeqh1c4f7L9DUfHuqWRtxh1JJHVEC9dZT+XRWxuUEe/A3wIAcdeAQ5t9BdedIPxkQDz pPHsZBZ5Aah+9JKtS9dP4KPIsm9rOodmleid6LoKa3Q0oImL+U05FdPDGRQjMTKzm/8k tYFFUD80QyAl3kNtrvViNhimDiztvee1LeiyhjaP1fsowRslfYieTHSHMNZR4biU42FS fsn890XPJBIc7w4Q5a6HSV9vsd6GnaDJ6pRgtBd2yeDL/OP4J4rfjPeDy4wII3s6euq4 rR4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=Sb3ykHY0s0lUwPOEpTQTKX0dDN9JeufCaNGO/9uVytU=; fh=3QIVKsEmsld8rvcEkMSr/XDw53o2lrGJeYcvS7FhzFk=; b=Jm9JtcppN31/RqXp+Jml44p+i/4wvPGswle4sAq3eAPicHU6pkbBI4r1j3NUkRFl++ MwZ5MV6EVB71F8DXMxnWOjF7PIRVgxG77CHHB55dpNKmVGxjX/wPpGyJC2Tgk5PqQ7k4 Fq4UmERefS+kEdKaNbzUXy8duB99Tm6tqGnetyuT8ao1i+07NiUjyPkf0wEv4veqmCqt meAwcbOogULZy2I/KUH06MYollrNow1UprsZSBznSPhWsAY4bAIkZndWwtcZbdXsIP4l CzLEN8MRWquN5JhZbJgR3kFH8rgwVaTU6cBSIX7kys+bk1Wvok7XJBglMWMM4FXWkYaM FXIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=bRdcAkZQ; dkim=neutral (no key) header.i=@suse.de; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Z7Sht93I; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=uJTPrEe7; spf=pass (google.com: domain of linux-kernel+bounces-3973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i16-20020a17090671d000b00a236ddb3476si79119ejk.434.2023.12.18.07.58.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 07:58:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=bRdcAkZQ; dkim=neutral (no key) header.i=@suse.de; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Z7Sht93I; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=uJTPrEe7; spf=pass (google.com: domain of linux-kernel+bounces-3973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0B7031F25898 for ; Mon, 18 Dec 2023 15:48:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E74C73A1D9; Mon, 18 Dec 2023 15:44:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="bRdcAkZQ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="wpY+fyfs"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Z7Sht93I"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uJTPrEe7" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C09C61D137 for ; Mon, 18 Dec 2023 15:44:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E189D21F89; Mon, 18 Dec 2023 15:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702914292; 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=Sb3ykHY0s0lUwPOEpTQTKX0dDN9JeufCaNGO/9uVytU=; b=bRdcAkZQuGRc4eQLw8ed49JvJ7Vz8idsz8j/Wbfj/yVy2XjvOLN5efe/lr/1nDGkP+1/kz LZENPBUvI4z+UmS6M4SAJWafIV0VkmYbeTsz99MTUSqfcyncTA/4dbZs/gYYGrAjO98CGy WL7ngNsoGrjHNiDdf47DJdPjF6K+vAk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702914292; 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=Sb3ykHY0s0lUwPOEpTQTKX0dDN9JeufCaNGO/9uVytU=; b=wpY+fyfsAzV3vI0PMl2YLuPGwEFIpcNTLrOMAUMvhb8h81BjXgoCJzwMTJo6IePAH0qI3v wRmb+CQgp0vHTnBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702914291; 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=Sb3ykHY0s0lUwPOEpTQTKX0dDN9JeufCaNGO/9uVytU=; b=Z7Sht93ICnE3oJDjxdA3ZdGBvvJE7nzAtpMfLo3kmbUoWuu1SGISjK3u23uQEG/rcuzDli kfp91NBUtdKE/Gtd2eCV6H0YFFK3/kDlBDITsvEUYb48kfTvdxUNScqRe/ypdLbnFO/nsx GHFCyGRkr5NxGJAK+NRTF//sc5jd19Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702914291; 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=Sb3ykHY0s0lUwPOEpTQTKX0dDN9JeufCaNGO/9uVytU=; b=uJTPrEe7Jte0p/vm4b2wzrm1nulDkFRFrtN3wQa+G3fQyMA/LsHG1w0Cl9V9dMC2A8VrqC Mi0CRnmHxZY68LAA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id D2B2113BC8; Mon, 18 Dec 2023 15:44:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id S4h/MvNogGXqfgAAn2gu4w (envelope-from ); Mon, 18 Dec 2023 15:44:51 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Keith Busch , James Smart , Hannes Reinecke , Daniel Wagner Subject: [PATCH v3 05/16] nvmet-fcloop: Remove remote port from list when unlinking Date: Mon, 18 Dec 2023 16:30:53 +0100 Message-ID: <20231218153105.12717-6-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218153105.12717-1-dwagner@suse.de> References: <20231218153105.12717-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spam-Level: X-Spamd-Result: default: False [0.89 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[8]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.01)[49.98%] Authentication-Results: smtp-out1.suse.de; none X-Spam-Score: 0.89 X-Spam-Flag: NO 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 c65a73433c05..ead349af30f1 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.43.0