mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 전민식 <hmi.jeon@samsung.com>
To: "kbusch@kernel.org" <kbusch@kernel.org>, "hch@lst.de" <hch@lst.de>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	"sagi@grimberg.me" <sagi@grimberg.me>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	전민식 <hmi.jeon@samsung.com>, 이은수 <euns212.lee@samsung.com>,
	칸찬 <joshi.k@samsung.com>
Subject: [PATCH v6] nvme: Skip trace complete_rq on host path error
Date: Thu, 16 Apr 2026 10:07:13 +0900	[thread overview]
Message-ID: <20260416010713epcms2p78575bd400f93f6edb7fe3f3ead5bf930@epcms2p7> (raw)
In-Reply-To: <CGME20260416010713epcms2p78575bd400f93f6edb7fe3f3ead5bf930@epcms2p7>

From cfd386c2d769552c4dd32ec8ff5233ef34f9830d Mon Sep 17 00:00:00 2001
From: Minsik Jeon <hmi.jeon@samsung.com>
Date: Thu, 16 Apr 2026 10:43:00 +0900
Subject: [PATCH v6] nvme: Skip trace complete_rq on host path error

we were checking host_pathing_error before calling nvme_setup_cmd().
This is caused the command setup to be skipped entirely when a pathing
error occurred, making it impossible to trace the nvme command via
trace_cmd nvme_complete_rq().

As a result, when nvme_complete_rq() logged a completion with cmdid=0,
it was impossible to correlate the completion with the nvme command
request.

This patch Skip trace_nvme_complete_rq() on NVMe host path error.

Co-authored-by: Beomsoo Kim <beomsooo.kim@samsung.com>
Co-authored-by: Eunsoo Lee <euns212.lee@samsung.com>
Co-authored-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Signed-off-by: Minsik Jeon <hmi.jeon@samsung.com>
---
 drivers/nvme/host/core.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1e33af94c24b..e92c97fad305 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -454,11 +454,10 @@ void nvme_end_req(struct request *req)
 	blk_mq_end_request(req, status);
 }
 
-void nvme_complete_rq(struct request *req)
+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);
-- 
2.52.0


       reply	other threads:[~2026-04-16  1:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260416010713epcms2p78575bd400f93f6edb7fe3f3ead5bf930@epcms2p7>
2026-04-16  1:07 ` 전민식 [this message]
2026-04-16 21:34   ` Chaitanya Kulkarni
2026-04-16 22:00   ` Keith Busch
     [not found]   ` <CGME20260416010713epcms2p78575bd400f93f6edb7fe3f3ead5bf930@epcms2p1>
2026-04-17  1:00     ` 전민식
2026-04-30  4:37   ` kernel test robot
2026-04-30  4:56   ` kernel test robot
2026-04-30  5:18   ` kernel test robot
     [not found]   ` <CGME20260430051839epcas2p20fce5951dc4a04138033e5943f1acdbf@epcms2p8>
2026-04-30  5:34     ` 전민식
2026-04-30 11:10       ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260416010713epcms2p78575bd400f93f6edb7fe3f3ead5bf930@epcms2p7 \
    --to=hmi.jeon@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=euns212.lee@samsung.com \
    --cc=hch@lst.de \
    --cc=joshi.k@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®