Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Keith Busch <kbusch@kernel.org>, Lei Lei2 Yin <yinlei2@lenovo.com>
Cc: "axboe@fb.com" <axboe@fb.com>, "hch@lst.de" <hch@lst.de>,
	"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: Sat, 8 Apr 2023 00:34:22 +0300	[thread overview]
Message-ID: <ab82c5fd-03d6-683d-2c8a-1b71b940d94a@grimberg.me> (raw)
In-Reply-To: <ZDBvTS1j26d3392/@kbusch-mbp.dhcp.thefacebook.com>


>> 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>

We need to change nvmf_complete_timed_out_request() too.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


  reply	other threads:[~2023-04-07 21:34 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
2023-04-07 21:34   ` Sagi Grimberg [this message]
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=ab82c5fd-03d6-683d-2c8a-1b71b940d94a@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=axboe@fb.com \
    --cc=cybeyond@foxmail.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --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