[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bf2b3a79-4e6e-4572-aa96-c318cb496cda@flourine.local>
Date: Tue, 4 Nov 2025 13:32:04 +0100
From: Daniel Wagner <dwagner@...e.de>
To: Hannes Reinecke <hare@...e.de>
Cc: Daniel Wagner <wagi@...nel.org>, Justin Tee <justin.tee@...adcom.com>,
Christoph Hellwig <hch@....de>, Keith Busch <kbusch@...nel.org>,
James Smart <james.smart@...adcom.com>, Jens Axboe <axboe@...nel.dk>, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] nvme-fc: don't hold rport lock when putting ctrl
On Tue, Nov 04, 2025 at 11:51:09AM +0100, Hannes Reinecke wrote:
> On 10/28/25 16:26, Daniel Wagner wrote:
> > nvme_fc_ctrl_put can acquire the rport lock when freeing the
> > ctrl object:
> >
> > nvme_fc_ctrl_put
> > nvme_fc_ctrl_free
> > spin_lock_irqsave(rport->lock)
> >
> > Thus we can't hold the rport lock when calling nvme_fc_ctrl_put.
> >
> > Signed-off-by: Daniel Wagner <wagi@...nel.org>
> > ---
> > drivers/nvme/host/fc.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> > index 03987f497a5b..2c0ea843ae57 100644
> > --- a/drivers/nvme/host/fc.c
> > +++ b/drivers/nvme/host/fc.c
> > @@ -1488,7 +1488,9 @@ nvme_fc_match_disconn_ls(struct nvme_fc_rport *rport,
> > if (ret)
> > /* leave the ctrl get reference */
> > break;
> > + spin_unlock_irqrestore(&rport->lock, flags);
> > nvme_fc_ctrl_put(ctrl);
> > + spin_lock_irqsave(&rport->lock, flags);
> > }
> > spin_unlock_irqrestore(&rport->lock, flags);
> >
> In theory, yes.
I hit this in practice ;)
Powered by blists - more mailing lists