From: Keith Busch Date: Thu, 6 Aug 2015 17:41:53 +0000 (-0700) Subject: NVMe: Don't use fake status on cancelled command X-Git-Tag: v4.1.12-92~311^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f3b40712e7601d7df329a48cb9ff34b94a7cb42b;p=users%2Fjedix%2Flinux-maple.git NVMe: Don't use fake status on cancelled command Synchronized commands do different things for timed out commands vs. controller returned errors. Signed-off-by: Keith Busch Signed-off-by: Jens Axboe (cherry picked from commit 17188bb403e9098a815dd850aedb6c150d2a3a6b) Conflicts: drivers/block/nvme-core.c Orabug: 21569452 Signed-off-by: Santosh Shilimkar --- diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index ade7cb9b7770..6f24dcbaa979 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -613,7 +613,14 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, spin_unlock_irqrestore(req->q->queue_lock, flags); return; } - req->errors = nvme_error_status(status); + if (req->cmd_type == REQ_TYPE_SPECIAL) { + if (cmd_rq->ctx == CMD_CTX_CANCELLED) + req->errors = -EINTR; + else + req->errors = status; + } else { + req->errors = nvme_error_status(status); + } } else req->errors = 0;