From: James Smart Date: Thu, 7 Mar 2019 01:08:12 +0000 (+0800) Subject: nvme: allow timed-out ios to retry X-Git-Tag: v4.1.12-124.31.3~107 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=39a6752b486c535a4e1b00cb6b9d3297a43a5dd7;p=users%2Fjedix%2Flinux-maple.git nvme: allow timed-out ios to retry Currently the nvme_req_needs_retry() applies several checks to see if a retry is allowed. On of those is whether the current time has exceeded the start time of the io plus the timeout length. This check, if an io times out, means there is never a retry allowed for the io. Which means applications see the io failure. Remove this check and allow the io to timeout, like it does on other protocols, and retries to be made. On the FC transport, a frame can be lost for an individual io, and there may be no other errors that escalate for the connection/association. The io will timeout, which causes the transport to escalate into creating a new association, but the io that timed out, due to this retry logic, has already failed back to the application and things are hosed. Signed-off-by: James Smart Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe (backport from upstream commit 0951338d9677f546e230685d68631dfd3f81cca5) There are two changes in this nvme_req_needs_retry before this commit, and there is no functional dependence on our issue. For simpler work, we don't backport them. Orabug: 29301607 Reviewed-by: Junxiao Bi Signed-off-by: Jianchao Wang Signed-off-by: Brian Maly --- diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 2c7e04fcc871..ba7d68034357 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -219,7 +219,6 @@ static inline int nvme_error_status(u16 status) static inline bool nvme_req_needs_retry(struct request *req, u16 status) { return !(status & NVME_SC_DNR || blk_noretry_request(req)) && - (jiffies - req->start_time) < req->timeout && req->retries < nvme_max_retries; }