From: Hannes Reinecke <hare@suse.de>
To: Daniel Wagner <dwagner@suse.de>
Cc: Daniel Wagner <wagi@kernel.org>,
James Smart <james.smart@broadcom.com>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
Keith Busch <kbusch@kernel.org>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 10/14] nvmet-fcloop: don't wait for lport cleanup
Date: Thu, 24 Apr 2025 14:10:20 +0200 [thread overview]
Message-ID: <8a3093b6-d5b2-496d-828a-0667abbf1670@suse.de> (raw)
In-Reply-To: <c1f207f3-6657-4803-90df-a059353ba6da@flourine.local>
On 4/24/25 13:48, Daniel Wagner wrote:
> On Thu, Apr 24, 2025 at 12:21:09PM +0200, Hannes Reinecke wrote:
>>> @@ -1776,7 +1763,7 @@ static void __exit fcloop_exit(void)
>>> spin_unlock_irqrestore(&fcloop_lock, flags);
>>> - ret = __wait_localport_unreg(lport);
>>> + ret = __localport_unreg(lport);
>>> if (ret)
>>> pr_warn("%s: Failed deleting local port\n", __func__);
>>>
>> And who is freeing the allocated fcloop_lsreq structures?
>
> After a fcloop_lsreq is allocated it is put on either rport->ls_list or
> tport->ls_list and later freed in fcloop_tport_lsrqst_work, resp.
> fcloop_rport_lsrqst_work for the non-error case (or in the callbacks).
>
> That means when the localport is unregistered successfully there are no
> fcloop_lsreq around. The issue is what to do when __localport_unreq
> returns an error.
>
> This code could loop forever when the port_state is not in
> FC_OBJSTATE_ONLINE when calling nvme_fc_unregister_localport(). This
> should not happen (it did before this series) but now it shouldn't be
> the case anymore. I suppose a pr_warn_once() and a sleep might be a good
> idea to avoid a busy loop?
My point was more: you call kmem_cache_destroy() unconditionally upon
exit. But the boilerplate says that you have to free all allocations
from the kmem_cache before that call.
Yet the exit function doesn't do that.
Question is: what are the guarantees that the cache is empty upon exit?
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2025-04-24 12:10 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 13:21 [PATCH v5 00/14] nvmet-fcloop: track resources via reference counting Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 01/14] nvmet-fcloop: track ref counts for nports Daniel Wagner
2025-04-24 10:08 ` Hannes Reinecke
2025-04-24 11:13 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 02/14] nvmet-fcloop: remove nport from list on last user Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 03/14] nvmet-fcloop: refactor fcloop_nport_alloc and track lport Daniel Wagner
2025-04-24 10:09 ` Hannes Reinecke
2025-04-23 13:21 ` [PATCH v5 04/14] nvmet-fcloop: refactor fcloop_delete_local_port Daniel Wagner
2025-04-24 10:10 ` Hannes Reinecke
2025-04-24 11:16 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 05/14] nvmet-fcloop: update refs on tfcp_req Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 06/14] nvmet-fcloop: add missing fcloop_callback_host_done Daniel Wagner
2025-04-24 10:13 ` Hannes Reinecke
2025-04-24 11:26 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 07/14] nvmet-fcloop: access fcpreq only when holding reqlock Daniel Wagner
2025-04-24 10:15 ` Hannes Reinecke
2025-04-24 11:31 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 08/14] nvmet-fcloop: prevent double port deletion Daniel Wagner
2025-04-24 10:17 ` Hannes Reinecke
2025-04-24 11:32 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 09/14] nvmet-fcloop: allocate/free fcloop_lsreq directly Daniel Wagner
2025-04-24 10:18 ` Hannes Reinecke
2025-05-07 10:48 ` kernel test robot
2025-04-23 13:21 ` [PATCH v5 10/14] nvmet-fcloop: don't wait for lport cleanup Daniel Wagner
2025-04-24 10:21 ` Hannes Reinecke
2025-04-24 11:48 ` Daniel Wagner
2025-04-24 12:10 ` Hannes Reinecke [this message]
2025-04-24 12:58 ` Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 11/14] nvmet-fcloop: drop response if targetport is gone Daniel Wagner
2025-04-24 10:21 ` Hannes Reinecke
2025-04-23 13:21 ` [PATCH v5 12/14] nvmet-fc: free pending reqs on tgtport unregister Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 13/14] nvmet-fc: take tgtport refs for portentry Daniel Wagner
2025-04-23 13:21 ` [PATCH v5 14/14] nvme-fc: do not reference lsrsp after failure Daniel Wagner
2025-05-06 16:36 ` [PATCH v5 00/14] nvmet-fcloop: track resources via reference counting Daniel Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8a3093b6-d5b2-496d-828a-0667abbf1670@suse.de \
--to=hare@suse.de \
--cc=dwagner@suse.de \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=wagi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).