[PATCH 3/3] nvme: redirect commands on dying queue

Sagi Grimberg sagi at grimberg.me
Fri Aug 14 14:44:12 EDT 2020


> If a command send through nvme-multupath failed on a dying queue, resend it
> on another path.

So this is a race where we got a retry-able status from the controller
(not from the host teardwon sequence) and we just happen to see
a dying queue?

I guess that can happen..
Reviewed-by: Sagi Grimberg <sagi at grimberg.me>


> 
> Signed-off-by: Chao Leng <lengchao at huawei.com>
> [hch: rebased on top of the completion refactoring]
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
>   drivers/nvme/host/core.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 8d474adad721fb..271cb9bf29dcd0 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -275,13 +275,13 @@ static inline enum nvme_disposition nvme_decide_disposition(struct request *req)
>   		return COMPLETE;
>   
>   	if (req->cmd_flags & REQ_NVME_MPATH) {
> -		if (nvme_is_path_error(status))
> +		if (nvme_is_path_error(status) || blk_queue_dying(req->q))
>   			return FAILOVER;
> +	} else {
> +		if (blk_queue_dying(req->q))
> +			return COMPLETE;
>   	}
>   
> -	if (blk_queue_dying(req->q))
> -		return COMPLETE;
> -
>   	return RETRY;
>   }
>   
> 



More information about the Linux-nvme mailing list