static inline bool nvme_req_needs_retry(struct request *req) { if (blk_noretry_request(req)) @@ -143,6 +204,11 @@ static inline bool nvme_req_needs_retry(struct request *req) void nvme_complete_rq(struct request *req) { if (unlikely(nvme_req(req)->status && nvme_req_needs_retry(req))) { + if (nvme_req_needs_failover(req)) { + nvme_failover_req(req); + return; + } + nvme_req(req)->retries++; blk_mq_requeue_request(req, true); return;
Nit, consider having the !nvme_req_needs_failover() case in an else clause, just a suggestion though.
@@ -171,6 +237,18 @@ void nvme_cancel_request(struct request *req, void *data, bool reserved) } EXPORT_SYMBOL_GPL(nvme_cancel_request);
Question, Does the statement in nvme_cancel_request: if (blk_queue_dying(req->q)) status |= NVME_SC_DNR; still holds?