lkml.org 
[lkml]   [2023]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] nvme: fix double blk_mq_complete_request for timeout request with low probability
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>

\
 
 \ /
  Last update: 2023-04-07 21:31    [W:0.080 / U:2.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site