Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@meta.com>, linux-nvme@lists.infradead.org
Subject: Re: [PATCHv3 1/2] nvme-pci: fix dma_vecs leak on p2p memory
Date: Thu, 21 May 2026 08:47:51 -0600	[thread overview]
Message-ID: <ag8bF5SLsKbtqgBc@kbusch-mbp> (raw)
In-Reply-To: <20260521082153.GA10917@lst.de>

On Thu, May 21, 2026 at 10:21:53AM +0200, Christoph Hellwig wrote:
> On Wed, May 20, 2026 at 10:49:52AM -0700, Keith Busch wrote:
> > From: Keith Busch <kbusch@kernel.org>
> > 
> > We don't unmap P2P memory, so allocating the dma_vec for it was being
> > leaked on completion.
> > 
> > Fixes: b8b7570a7ec87 ("nvme-pci: fix dma unmapping when using PRPs and not using the IOVA mapping")
> > Signed-off-by: Keith Busch <kbusch@kernel.org>
> > ---
> >  drivers/nvme/host/pci.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> > index 139a10cd687f9..744b388eea956 100644
> > --- a/drivers/nvme/host/pci.c
> > +++ b/drivers/nvme/host/pci.c
> > @@ -966,7 +966,8 @@ static bool nvme_pci_prp_save_mapping(struct request *req,
> >  {
> >  	struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
> >  
> > -	if (dma_use_iova(&iod->dma_state) || !dma_need_unmap(dma_dev))
> > +	if (dma_use_iova(&iod->dma_state) || !dma_need_unmap(dma_dev) ||
> > +	    iod->flags & IOD_DATA_P2P)
> 
> Missing braces around the & for our usual style?

Thanks, fixed up and applied.


      reply	other threads:[~2026-05-21 14:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 17:49 [PATCHv3 1/2] nvme-pci: fix dma_vecs leak on p2p memory Keith Busch
2026-05-20 17:49 ` [PATCHv3 2/2] nvme-pci: fix dma mapping leak on data setup error Keith Busch
2026-05-21  8:23   ` Christoph Hellwig
2026-05-21  8:21 ` [PATCHv3 1/2] nvme-pci: fix dma_vecs leak on p2p memory Christoph Hellwig
2026-05-21 14:47   ` Keith Busch [this message]

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=ag8bF5SLsKbtqgBc@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=hch@lst.de \
    --cc=kbusch@meta.com \
    --cc=linux-nvme@lists.infradead.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