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

Chao Leng lengchao at huawei.com
Mon Aug 17 01:49:47 EDT 2020



On 2020/8/17 11:41, Chao Leng wrote:
> 
> 
> On 2020/8/14 23:15, Christoph Hellwig wrote:
>> From: Chao Leng <lengchao at huawei.com>
>>
>> If a command send through nvme-multupath failed on a dying queue, resend it
>> on another path.
>>
>> 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;
>>   } 
> If path related error, retry maybe fail again. So we should not retry local
> for path related error. Suggest do like this:
>      if (nvme_is_path_error(status) || blk_queue_dying(req->q)) {
>          if (req->cmd_flags & REQ_NVME_MPATH)
>              return FAILOVER;
>          else
>              return COMPLETE;
If without any multipath, will not retry. This may not be what we expected.
If we can support both NVMe multipathing and third-party multipathing,
it would be great. In addition to DM-MULTIPATH, third-party multipathing
software is provided by storage vendors, such as PowerPath(DELL&EMC),
SecurePath(hp), Ultrapath(huawei), etc.
>      }
>      return RETRY;
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme



More information about the Linux-nvme mailing list