]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
nvme: redirect commands on dying queue
authorChao Leng <lengchao@huawei.com>
Tue, 18 Aug 2020 07:11:32 +0000 (09:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 21 Aug 2020 23:14:28 +0000 (17:14 -0600)
If a command send through nvme-multipath failed on a dying queue, resend it
on another path.

Signed-off-by: Chao Leng <lengchao@huawei.com>
[hch: rebased on top of the completion refactoring]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c

index 9e75f6f62471aaa853f0ed3ba1450dad6b19864b..c9826ecf80e2afed1dffaf0ab4d97718a13ba96b 100644 (file)
@@ -274,13 +274,14 @@ 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(nvme_req(req)->status))
+               if (nvme_is_path_error(nvme_req(req)->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;
 }