瀏覽代碼

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>
Keith Busch 10 年之前
父節點
當前提交
17188bb403
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      drivers/block/nvme-core.c

+ 4 - 1
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);
 		}