[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <030b7827-5060-44bc-b5ee-b1833063b835@flourine.local>
Date: Tue, 18 Mar 2025 14:44:18 +0100
From: Daniel Wagner <dwagner@...e.de>
To: Hannes Reinecke <hare@...e.de>
Cc: Daniel Wagner <wagi@...nel.org>,
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 v3 05/18] nvmet-fcloop: track ref counts for nports
On Tue, Mar 18, 2025 at 12:06:54PM +0100, Hannes Reinecke wrote:
> On 3/18/25 11:39, Daniel Wagner wrote:
> > A nport object is always used in association with targerport,
> > remoteport, tport and rport objects. Add explicit references for any of
> > the associated object. This ensures that nport is not removed too early
> > on shutdown sequences.
> >
> > Signed-off-by: Daniel Wagner <wagi@...nel.org>
> > ---
> > drivers/nvme/target/fcloop.c | 106 +++++++++++++++++++++++++------------------
> > 1 file changed, 63 insertions(+), 43 deletions(-)
> >
> > diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c
> > index 245bfe08d91ec81f1979251e8c757a0d46fd09e9..69121a5f0f280936d1b720e9e994d6e5eb9186ff 100644
> > --- a/drivers/nvme/target/fcloop.c
> > +++ b/drivers/nvme/target/fcloop.c
> > @@ -1054,8 +1054,15 @@ static void
> > fcloop_remoteport_delete(struct nvme_fc_remote_port *remoteport)
> > {
> > struct fcloop_rport *rport = remoteport->private;
> > + unsigned long flags;
> > flush_work(&rport->ls_work);
> > +
> > + spin_lock_irqsave(&fcloop_lock, flags);
> > + rport->nport->rport = NULL;
> > + spin_unlock_irqrestore(&fcloop_lock, flags);
> > +
> > + /* nport ref put: rport */
> > fcloop_nport_put(rport->nport);
> > }
> The comment is a bit odd; obviously fcloop_nport_put() puts the nport
> reference for the rport.
> Maybe just remove them?
Sure, I left in it, to figure out which of the get/put pair up. This was
not so clear during the various stages of this series. Now that there is
a rport->nport and tport->nport is left, it's indeed a bit useles.
Powered by blists - more mailing lists