[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <771a6319-75cc-4026-9c7f-d2c31f303bf5@flourine.local>
Date: Fri, 28 Feb 2025 15:31:22 +0100
From: Daniel Wagner <dwagner@...e.de>
To: Hannes Reinecke <hare@...e.de>
Cc: James Smart <james.smart@...adcom.com>, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>, Chaitanya Kulkarni <kch@...dia.com>,
Keith Busch <kbusch@...nel.org>, linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/11] nvmet-fcloop: track tport with ref counting
On Fri, Feb 28, 2025 at 09:30:42AM +0100, Daniel Wagner wrote:
> On Fri, Feb 28, 2025 at 08:27:40AM +0100, Hannes Reinecke wrote:
> > > if (!tport->remoteport) {
> > > tls_req->status = -ECONNREFUSED;
> > > spin_lock(&tport->lock);
> > > list_add_tail(&tls_req->ls_list, &tport->ls_list);
> > > spin_unlock(&tport->lock);
> > > - queue_work(nvmet_wq, &tport->ls_work);
> > > + if (queue_work(nvmet_wq, &tport->ls_work))
> > > + fcloop_tport_get(tport);
> >
> > Don't you need to remove the 'tls_req' from the list, too, seeing that
> > it'll never be transferred?
>
> Good point. I'll add the error handling.
In fact, I think a WARN_ONCE is the better choice here, as the element
should not be on the list (an error in the code) and queue_work will only
return false if the work item is already scheduled.
Powered by blists - more mailing lists