]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
nvme: introduce "Command Aborted By host" status code
authorMax Gurtovoy <maxg@mellanox.com>
Sun, 13 Oct 2019 16:57:35 +0000 (19:57 +0300)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 14:16:11 +0000 (08:16 -0600)
BugLink: https://bugs.launchpad.net/bugs/1858428
[ Upstream commit 2dc3947b53f573e8a75ea9cbec5588df88ca502e ]

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: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
include/linux/nvme.h

index af3212aec87193b15165141e3e1a7aa1dc81efc9..b4e1e4379f1f03bd24f5491dfcef7422f87bf5b7 100644 (file)
@@ -313,7 +313,7 @@ bool nvme_cancel_request(struct request *req, void *data, bool reserved)
        if (blk_mq_request_completed(req))
                return true;
 
-       nvme_req(req)->status = NVME_SC_HOST_PATH_ERROR;
+       nvme_req(req)->status = NVME_SC_HOST_ABORTED_CMD;
        blk_mq_complete_request(req);
        return true;
 }
index e0f064dcbd0211ec188cde84de322ffc7880d40a..132ade51ee877745d5797e48e69aafe49983fea6 100644 (file)
@@ -95,6 +95,7 @@ void nvme_failover_req(struct request *req)
                }
                break;
        case NVME_SC_HOST_PATH_ERROR:
+       case NVME_SC_HOST_ABORTED_CMD:
                /*
                 * Temporary transport disruption in talking to the controller.
                 * Try to send on a new path.
index f61d6906e59d1242ca378a9fccf39f0f7f2b6627..a260cd754f28ba098efd6cbe2358c6de508de55f 100644 (file)
@@ -1368,6 +1368,7 @@ enum {
        NVME_SC_ANA_INACCESSIBLE        = 0x302,
        NVME_SC_ANA_TRANSITION          = 0x303,
        NVME_SC_HOST_PATH_ERROR         = 0x370,
+       NVME_SC_HOST_ABORTED_CMD        = 0x371,
 
        NVME_SC_CRD                     = 0x1800,
        NVME_SC_DNR                     = 0x4000,