NVMe: Don't use fake status on cancelled command
authorKeith Busch <keith.busch@intel.com>
Mon, 8 Jun 2015 16:08:14 +0000 (10:08 -0600)
committerJens Axboe <axboe@fb.com>
Sat, 27 Jun 2015 17:42:50 +0000 (11:42 -0600)
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>
drivers/block/nvme-core.c

index a457003..2cbe1b4 100644 (file)
@@ -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);
                }