From f3b40712e7601d7df329a48cb9ff34b94a7cb42b Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Thu, 6 Aug 2015 10:41:53 -0700 Subject: [PATCH] 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 --- drivers/block/nvme-core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- 2.50.1