提交 7fa1a1b7 编写于 作者: M Max Gurtovoy 提交者: Yang Yingliang

nvme: introduce "Command Aborted By host" status code

mainline inclusion
from mainline-v5.5-rc1
commit 2dc3947b
category: bugfix
bugzilla: NA
CVE: NA
Link: https://gitee.com/openeuler/kernel/issues/I1WGZE

--------------------------------

Fix the status code of canceled requests initiated by the host according
to TP4028 (Status Code 0x371):
"Command Aborted By host: The command was aborted as a result of host
action (e.g., the host disconnected the Fabric connection)."

Also in a multipath environment, unless otherwise specified, errors of
this type (path related) should be retried using a different path, if
one is available.
Signed-off-by: NMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NKeith Busch <kbusch@kernel.org>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Reviewed-by: NChao Leng <lengchao@huawei.com>
Reviewed-by: NJike Cheng <chengjike.cheng@huawei.com>
Signed-off-by: NLijie <lijie34@huawei.com>
Reviewed-by: NTao Hou <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 18420a7a
...@@ -298,7 +298,7 @@ void nvme_cancel_request(struct request *req, void *data, bool reserved) ...@@ -298,7 +298,7 @@ void nvme_cancel_request(struct request *req, void *data, bool reserved)
if (blk_mq_request_completed(req)) if (blk_mq_request_completed(req))
return; return;
nvme_req(req)->status = NVME_SC_ABORT_REQ; nvme_req(req)->status = NVME_SC_HOST_ABORTED_CMD;
blk_mq_complete_request(req); blk_mq_complete_request(req);
} }
......
...@@ -98,6 +98,7 @@ bool nvme_failover_req(struct request *req) ...@@ -98,6 +98,7 @@ bool nvme_failover_req(struct request *req)
} }
break; break;
case NVME_SC_HOST_PATH_ERROR: case NVME_SC_HOST_PATH_ERROR:
case NVME_SC_HOST_ABORTED_CMD:
/* /*
* Temporary transport disruption in talking to the controller. * Temporary transport disruption in talking to the controller.
* Try to send on a new path. * Try to send on a new path.
......
...@@ -1256,6 +1256,7 @@ enum { ...@@ -1256,6 +1256,7 @@ enum {
NVME_SC_ANA_INACCESSIBLE = 0x302, NVME_SC_ANA_INACCESSIBLE = 0x302,
NVME_SC_ANA_TRANSITION = 0x303, NVME_SC_ANA_TRANSITION = 0x303,
NVME_SC_HOST_PATH_ERROR = 0x370, NVME_SC_HOST_PATH_ERROR = 0x370,
NVME_SC_HOST_ABORTED_CMD = 0x371,
NVME_SC_CRD = 0x1800, NVME_SC_CRD = 0x1800,
NVME_SC_DNR = 0x4000, NVME_SC_DNR = 0x4000,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册