]> Git Repo - linux.git/commitdiff
nvme: add NVME_REQ_CANCELLED flag in nvme_cancel_request()
authorHannes Reinecke <[email protected]>
Fri, 26 Feb 2021 07:17:26 +0000 (08:17 +0100)
committerChristoph Hellwig <[email protected]>
Thu, 11 Mar 2021 10:48:34 +0000 (11:48 +0100)
NVME_REQ_CANCELLED is translated into -EINTR in nvme_submit_sync_cmd(),
so we should be setting this flags during nvme_cancel_request() to
ensure that the callers to nvme_submit_sync_cmd() will get the correct
error code when the controller is reset.

Signed-off-by: Hannes Reinecke <[email protected]>
Reviewed-by: Keith Busch <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Reviewed-by: Chao Leng <[email protected]>
Reviewed-by: Daniel Wagner <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
drivers/nvme/host/core.c

index e084120c3453c3fbaca8d3fe4af76e76cc1de1c4..63bb1da0861e9daec602247e9c4d1383c8d42e37 100644 (file)
@@ -380,6 +380,7 @@ bool nvme_cancel_request(struct request *req, void *data, bool reserved)
                return true;
 
        nvme_req(req)->status = NVME_SC_HOST_ABORTED_CMD;
+       nvme_req(req)->flags |= NVME_REQ_CANCELLED;
        blk_mq_complete_request(req);
        return true;
 }
This page took 0.0709070000000001 seconds and 4 git commands to generate.