summaryrefslogtreecommitdiffstats
path: root/drivers/block/nvme-core.c
diff options
context:
space:
mode:
authorKeith Busch2015-06-08 18:08:14 +0200
committerJens Axboe2015-06-27 19:42:50 +0200
commit17188bb403e9098a815dd850aedb6c150d2a3a6b (patch)
tree7cd0d4ce979c852a94b7b0fa982308e8cf85b262 /drivers/block/nvme-core.c
parentNVMe: Fix device cleanup on initialization failure (diff)
downloadkernel-qcow2-linux-17188bb403e9098a815dd850aedb6c150d2a3a6b.tar.gz
kernel-qcow2-linux-17188bb403e9098a815dd850aedb6c150d2a3a6b.tar.xz
kernel-qcow2-linux-17188bb403e9098a815dd850aedb6c150d2a3a6b.zip
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 <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/nvme-core.c')
-rw-r--r--drivers/block/nvme-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index a45700312caf..2cbe1b4daef2 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -613,7 +613,10 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx,
return;
}
if (req->cmd_type == REQ_TYPE_DRV_PRIV) {
- req->errors = status;
+ if (cmd_rq->ctx == CMD_CTX_CANCELLED)
+ req->errors = -EINTR;
+ else
+ req->errors = status;
} else {
req->errors = nvme_error_status(status);
}