public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Chaitanya Kulkarni <ckulkarnilinux@gmail.com>,
	"kbusch@kernel.org" <kbusch@kernel.org>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"sagi@grimberg.me" <sagi@grimberg.me>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH BUG FIX 2/2] nvme-multipath: clear BIO_QOS flags on requeue
Date: Mon, 24 Nov 2025 08:01:42 +0100	[thread overview]
Message-ID: <20251124070142.GA17632@lst.de> (raw)
In-Reply-To: <a3159403-7344-4627-a413-f289a313c12a@nvidia.com>

On Mon, Nov 24, 2025 at 06:45:58AM +0000, Chaitanya Kulkarni wrote:
> >> Fix this by clearing both BIO_QOS_THROTTLED and BIO_QOS_MERGED flags
> >> when bios are redirected to the multipath head in nvme_failover_req().
> >> This is consistent with the existing code that clears REQ_POLLED and
> >> REQ_NOWAIT flags when the bio changes queues.
> >>
> >> Signed-off-by: Chaitanya Kulkarni <ckulkarnilinux@gmail.com>
> >> ---
> >>   drivers/nvme/host/multipath.c | 10 ++++++++++
> >>   1 file changed, 10 insertions(+)
> >>
> >> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> >> index 3da980dc60d9..2535dba8ce1e 100644
> >> --- a/drivers/nvme/host/multipath.c
> >> +++ b/drivers/nvme/host/multipath.c
> >> @@ -168,6 +168,16 @@ void nvme_failover_req(struct request *req)
> >>   		 * the flag to avoid spurious EAGAIN I/O failures.
> >>   		 */
> >>   		bio->bi_opf &= ~REQ_NOWAIT;
> >> +		/*
> >> +		 * BIO_QOS_THROTTLED and BIO_QOS_MERGED were set when the bio
> >> +		 * went through the path's request queue rq_qos infrastructure.
> >> +		 * The bio is now being redirected to the multipath head's
> >> +		 * queue which may not have rq_qos enabled, so these flags are
> >> +		 * no longer valid and must be cleared to prevent
> >> +		 * rq_qos_done_bio() from dereferencing a NULL q->rq_qos.
> >> +		 */
> >> +		bio_clear_flag(bio, BIO_QOS_THROTTLED);
> >> +		bio_clear_flag(bio, BIO_QOS_MERGED);
> > This really should go into blk_steal_bios instead.  As should be the
> > existing nowait/polled fixups..
> >
> >
> even better, should I send a prep patch to move existing nowait/polled
> and second patch for QOS THROTTLED and MERGED that fixes the bug ?

Yes, we can probably move all of them including your new clear
in a separate patch (and wait until the next merge window).


      reply	other threads:[~2025-11-24  7:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-23 19:18 [PATCH 0/2] nvme: blktests bug fix for 6.19 Chaitanya Kulkarni
2025-11-23 19:18 ` [PATCH BUF FIX 1/2] nvme-tcp: use __fput_sync() to avoid use-after-free on reset Chaitanya Kulkarni
2025-11-24  6:24   ` Christoph Hellwig
2025-11-23 19:18 ` [PATCH BUG FIX 2/2] nvme-multipath: clear BIO_QOS flags on requeue Chaitanya Kulkarni
2025-11-24  6:25   ` Christoph Hellwig
2025-11-24  6:45     ` Chaitanya Kulkarni
2025-11-24  7:01       ` Christoph Hellwig [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=20251124070142.GA17632@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=chaitanyak@nvidia.com \
    --cc=ckulkarnilinux@gmail.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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