Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Lei Lei2 Yin <yinlei2@lenovo.com>
Cc: "axboe@fb.com" <axboe@fb.com>, "hch@lst.de" <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cybeyond@foxmail.com" <cybeyond@foxmail.com>
Subject: Re: [PATCH] nvme: fix double blk_mq_complete_request for timeout request with low probability
Date: Fri, 7 Apr 2023 13:30:21 -0600	[thread overview]
Message-ID: <ZDBvTS1j26d3392/@kbusch-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <PS1PR03MB4939C825BD5D9A135AA0EB9188919@PS1PR03MB4939.apcprd03.prod.outlook.com>

On Thu, Apr 06, 2023 at 04:18:18PM +0000, Lei Lei2 Yin wrote:
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 53ef028596c6..c1cc384f4f3e 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -450,8 +450,8 @@ bool nvme_cancel_request(struct request *req, void *data)
>  	dev_dbg_ratelimited(((struct nvme_ctrl *) data)->device,
>  				"Cancelling I/O %d", req->tag);
>  
> -	/* don't abort one completed request */
> -	if (blk_mq_request_completed(req))
> +	/* don't abort one completed or idle request */
> +	if (blk_mq_rq_state(req) != MQ_RQ_IN_FLIGHT)
>  		return true;

I was suspicious about this path too, and had the same change long ago, but
shelved it when I couldn't produce any errors there. But the change makes sense
to me!

Reviewed-by: Keith Busch <kbusch@kernel.org>


  reply	other threads:[~2023-04-07 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 16:18 [PATCH] nvme: fix double blk_mq_complete_request for timeout request with low probability Lei Lei2 Yin
2023-04-07 19:30 ` Keith Busch [this message]
2023-04-07 21:34   ` Sagi Grimberg
2023-04-11  6:08 ` hch

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=ZDBvTS1j26d3392/@kbusch-mbp.dhcp.thefacebook.com \
    --to=kbusch@kernel.org \
    --cc=axboe@fb.com \
    --cc=cybeyond@foxmail.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=yinlei2@lenovo.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