diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 22d8013cd4ff..ccdd02fa6882 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -363,9 +363,14 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, } nvme_free_iod(nvmeq->dev, iod); - if (unlikely(status)) + if (unlikely(status)) { + if (!(status & NVME_SC_DNR || blk_noretry_request(req)) + && (jiffies - req->start_time) < req->timeout) { + blk_mq_requeue_request(req); + return; + } req->errors = -EIO; - else + } else req->errors = 0; blk_mq_complete_request(req);