aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/nvme
diff options
context:
space:
mode:
authorChao Leng <lengchao@huawei.com>2020-08-18 09:11:32 +0200
committerJens Axboe <axboe@kernel.dk>2020-08-21 17:14:28 -0600
commit5eac5f3342b20825260d3800e7f5f74f12bac931 (patch)
treef65fb11a3637f89cad5e07d539a6752363544a94 /drivers/nvme
parentnvme: just check the status code type in nvme_is_path_error (diff)
downloadwireguard-linux-5eac5f3342b20825260d3800e7f5f74f12bac931.tar.xz
wireguard-linux-5eac5f3342b20825260d3800e7f5f74f12bac931.zip
nvme: redirect commands on dying queue
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>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/core.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 9e75f6f62471..c9826ecf80e2 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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;
}