drivers/nvme/host/core.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
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
Hi 전민식,
kernel test robot noticed the following build warnings:
[auto build test WARNING on axboe/for-next]
[also build test WARNING on linux-nvme/for-next linus/master v7.1-rc1]
[cannot apply to next-20260429]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/nvme-Skip-trace-complete_rq-on-host-path-error/20260416-180151
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link: https://lore.kernel.org/r/20260416010713epcms2p78575bd400f93f6edb7fe3f3ead5bf930%40epcms2p7
patch subject: [PATCH v6] nvme: Skip trace complete_rq on host path error
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260430/202604300750.YpUGtmek-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604300750.YpUGtmek-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604300750.YpUGtmek-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/nvme/host/core.c:457:6: warning: no previous prototype for '__nvme_complete_rq' [-Wmissing-prototypes]
457 | void __nvme_complete_rq(struct request *req)
| ^~~~~~~~~~~~~~~~~~
vim +/__nvme_complete_rq +457 drivers/nvme/host/core.c
456
> 457 void __nvme_complete_rq(struct request *req)
458 {
459 struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
460
461 nvme_cleanup_cmd(req);
462
463 /*
464 * Completions of long-running commands should not be able to
465 * defer sending of periodic keep alives, since the controller
466 * may have completed processing such commands a long time ago
467 * (arbitrarily close to command submission time).
468 * req->deadline - req->timeout is the command submission time
469 * in jiffies.
470 */
471 if (ctrl->kas &&
472 req->deadline - req->timeout >= ctrl->ka_last_check_time)
473 ctrl->comp_seen = true;
474
475 switch (nvme_decide_disposition(req)) {
476 case COMPLETE:
477 nvme_end_req(req);
478 return;
479 case RETRY:
480 nvme_retry_req(req);
481 return;
482 case FAILOVER:
483 nvme_failover_req(req);
484 return;
485 case AUTHENTICATE:
486 #ifdef CONFIG_NVME_HOST_AUTH
487 queue_work(nvme_wq, &ctrl->dhchap_auth_work);
488 nvme_retry_req(req);
489 #else
490 nvme_end_req(req);
491 #endif
492 return;
493 }
494 }
495
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
On Thu, Apr 17, 2026 at 01:00 UTC, 전민식 wrote: > On Thu, Apr 16, 2026 at 22:00 UTC, Keith Busch wrote: > > You're missing the "static" declaration, which was present in the > > original suggestion: > > > > https://lore.kernel.org/linux-nvme/acVCnozG1WKPkq1L@kbusch-mbp/ > > > > Should I just apply my local copy? I think it's an original patch from > > me at this point. > > Please go ahead and apply your local copy. > I appreciate your help in finalizing the patch. Hi Keith, Are you planning to apply your local fix directly? Thanks, Minsik Jeon
On Thu, Apr 30, 2026 at 02:34:01PM +0900, 전민식 wrote: > Are you planning to apply your local fix directly? It's already committed to the block tree and should land upstream this week.
Hi 전민식,
kernel test robot noticed the following build warnings:
[auto build test WARNING on axboe/for-next]
[also build test WARNING on linux-nvme/for-next hch-configfs/for-next linus/master v7.1-rc1]
[cannot apply to next-20260429]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/nvme-Skip-trace-complete_rq-on-host-path-error/20260416-180151
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link: https://lore.kernel.org/r/20260416010713epcms2p78575bd400f93f6edb7fe3f3ead5bf930%40epcms2p7
patch subject: [PATCH v6] nvme: Skip trace complete_rq on host path error
config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20260430/202604301237.jC9FNHxS-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604301237.jC9FNHxS-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604301237.jC9FNHxS-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/nvme/host/core.c:457:6: warning: no previous prototype for '__nvme_complete_rq' [-Wmissing-prototypes]
457 | void __nvme_complete_rq(struct request *req)
| ^~~~~~~~~~~~~~~~~~
vim +/__nvme_complete_rq +457 drivers/nvme/host/core.c
456
> 457 void __nvme_complete_rq(struct request *req)
458 {
459 struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
460
461 nvme_cleanup_cmd(req);
462
463 /*
464 * Completions of long-running commands should not be able to
465 * defer sending of periodic keep alives, since the controller
466 * may have completed processing such commands a long time ago
467 * (arbitrarily close to command submission time).
468 * req->deadline - req->timeout is the command submission time
469 * in jiffies.
470 */
471 if (ctrl->kas &&
472 req->deadline - req->timeout >= ctrl->ka_last_check_time)
473 ctrl->comp_seen = true;
474
475 switch (nvme_decide_disposition(req)) {
476 case COMPLETE:
477 nvme_end_req(req);
478 return;
479 case RETRY:
480 nvme_retry_req(req);
481 return;
482 case FAILOVER:
483 nvme_failover_req(req);
484 return;
485 case AUTHENTICATE:
486 #ifdef CONFIG_NVME_HOST_AUTH
487 queue_work(nvme_wq, &ctrl->dhchap_auth_work);
488 nvme_retry_req(req);
489 #else
490 nvme_end_req(req);
491 #endif
492 return;
493 }
494 }
495
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi 전민식,
kernel test robot noticed the following build warnings:
[auto build test WARNING on axboe/for-next]
[also build test WARNING on linux-nvme/for-next linus/master v7.1-rc1]
[cannot apply to next-20260429]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/nvme-Skip-trace-complete_rq-on-host-path-error/20260416-180151
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link: https://lore.kernel.org/r/20260416010713epcms2p78575bd400f93f6edb7fe3f3ead5bf930%40epcms2p7
patch subject: [PATCH v6] nvme: Skip trace complete_rq on host path error
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260430/202604300644.6qVuhQQC-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604300644.6qVuhQQC-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604300644.6qVuhQQC-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/nvme/host/core.c:457:6: warning: no previous prototype for function '__nvme_complete_rq' [-Wmissing-prototypes]
457 | void __nvme_complete_rq(struct request *req)
| ^
drivers/nvme/host/core.c:457:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
457 | void __nvme_complete_rq(struct request *req)
| ^
| static
1 warning generated.
vim +/__nvme_complete_rq +457 drivers/nvme/host/core.c
456
> 457 void __nvme_complete_rq(struct request *req)
458 {
459 struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
460
461 nvme_cleanup_cmd(req);
462
463 /*
464 * Completions of long-running commands should not be able to
465 * defer sending of periodic keep alives, since the controller
466 * may have completed processing such commands a long time ago
467 * (arbitrarily close to command submission time).
468 * req->deadline - req->timeout is the command submission time
469 * in jiffies.
470 */
471 if (ctrl->kas &&
472 req->deadline - req->timeout >= ctrl->ka_last_check_time)
473 ctrl->comp_seen = true;
474
475 switch (nvme_decide_disposition(req)) {
476 case COMPLETE:
477 nvme_end_req(req);
478 return;
479 case RETRY:
480 nvme_retry_req(req);
481 return;
482 case FAILOVER:
483 nvme_failover_req(req);
484 return;
485 case AUTHENTICATE:
486 #ifdef CONFIG_NVME_HOST_AUTH
487 queue_work(nvme_wq, &ctrl->dhchap_auth_work);
488 nvme_retry_req(req);
489 #else
490 nvme_end_req(req);
491 #endif
492 return;
493 }
494 }
495
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
On Thu, Apr 16, 2026 at 10:07:13AM +0900, 전민식 wrote: > 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> ... > -void nvme_complete_rq(struct request *req) > +void __nvme_complete_rq(struct request *req) You're missing the "static" declaration, which was present in the original suggestion: https://lore.kernel.org/linux-nvme/acVCnozG1WKPkq1L@kbusch-mbp/ Should I just apply my local copy? I think it's an original patch from me at this point.
On Thu, Apr 16, 2026 at 22:00 UTC, Keith Busch wrote: > You're missing the "static" declaration, which was present in the > original suggestion: > > https://lore.kernel.org/linux-nvme/acVCnozG1WKPkq1L@kbusch-mbp/ > > Should I just apply my local copy? I think it's an original patch from > me at this point. Please go ahead and apply your local copy. I appreciate your help in finalizing the patch. Thanks, Minsik Jeon
On 4/15/26 18:07, 전민식 wrote: > 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> > --- Is it possible to send this patch using git send-email ? Also, do you see any performance difference after this change ? I don't expect any but it's better to document if any since this is in the fast path. -ck
© 2016 - 2026 Red Hat, Inc.