]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvme: skip trace completion for host path errors
authorKeith Busch <kbusch@kernel.org>
Mon, 20 Apr 2026 16:02:28 +0000 (09:02 -0700)
committerKeith Busch <kbusch@kernel.org>
Wed, 22 Apr 2026 17:06:23 +0000 (10:06 -0700)
The command was never dispatched for the driver's "host path error", so
the command was never actually initialized and there's no corresponding
submit trace for the completion.

Reported-by: Minsik Jeon <hmi.jeon@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c

index fead3b7cd4beafe46d083bf099dcc7f83f1e9640..d62adebfdc68a7557124fbf28a2b00525b2dbfa7 100644 (file)
@@ -454,11 +454,10 @@ void nvme_end_req(struct request *req)
        blk_mq_end_request(req, status);
 }
 
-void nvme_complete_rq(struct request *req)
+static void __nvme_complete_rq(struct request *req)
 {
        struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
 
-       trace_nvme_complete_rq(req);
        nvme_cleanup_cmd(req);
 
        /*
@@ -493,6 +492,12 @@ void nvme_complete_rq(struct request *req)
                return;
        }
 }
+
+void nvme_complete_rq(struct request *req)
+{
+       trace_nvme_complete_rq(req);
+       __nvme_complete_rq(req);
+}
 EXPORT_SYMBOL_GPL(nvme_complete_rq);
 
 void nvme_complete_batch_req(struct request *req)
@@ -513,7 +518,7 @@ blk_status_t nvme_host_path_error(struct request *req)
 {
        nvme_req(req)->status = NVME_SC_HOST_PATH_ERROR;
        blk_mq_set_request_complete(req);
-       nvme_complete_rq(req);
+       __nvme_complete_rq(req);
        return BLK_STS_OK;
 }
 EXPORT_SYMBOL_GPL(nvme_host_path_error);