public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@meta.com>
Cc: linux-block@vger.kernel.org, axboe@kernel.dk, hch@lst.de,
	Keith Busch <kbusch@kernel.org>,
	Sebastian Ott <sebott@redhat.com>
Subject: Re: [PATCH] blk-mq-dma: always initialize dma state
Date: Wed, 10 Dec 2025 07:54:07 +0100	[thread overview]
Message-ID: <20251210065407.GA650@lst.de> (raw)
In-Reply-To: <20251210064915.3196916-1-kbusch@meta.com>

On Tue, Dec 09, 2025 at 10:49:15PM -0800, Keith Busch wrote:
> -	if (blk_can_dma_map_iova(req, dma_dev) &&
> -	    dma_iova_try_alloc(dma_dev, state, vec.paddr, total_len))
> +	if (!blk_can_dma_map_iova(req, dma_dev))
> +		memset(state, 0, sizeof(*state));
> +	else if (dma_iova_try_alloc(dma_dev, state, vec.paddr, total_len))
>  		return blk_rq_dma_map_iova(req, dma_dev, state, iter, &vec);

What about just doing the memset unconditionally?  It's just two
64-bit fields so no real overhead, and it gives us a clean slate that
avoid introducing other bugs later on.


  reply	other threads:[~2025-12-10  6:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10  6:49 [PATCH] blk-mq-dma: always initialize dma state Keith Busch
2025-12-10  6:54 ` Christoph Hellwig [this message]
2025-12-10  7:06   ` Keith Busch
2025-12-10  8:25     ` Christoph Hellwig
2025-12-10 10:38 ` Sebastian Ott

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=20251210065407.GA650@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.org \
    --cc=sebott@redhat.com \
    /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