Skip to content

Commit 442e44d

Browse files
committed
nvme: fix multipath batched completion accounting
jira LE-2157 Rebuild_History Non-Buildable kernel-5.14.0-503.14.1.el9_5 commit-author Keith Busch <kbusch@kernel.org> commit 2fe7b42 Batched completions were missing the io stats accounting and bio trace events. Move the common code to a helper and call it from the batched and non-batched functions. Fixes: d4d957b ("nvme-multipath: support io stats on the mpath device") Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Keith Busch <kbusch@kernel.org> (cherry picked from commit 2fe7b42) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 013a923 commit 442e44d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/nvme/host/core.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,14 @@ static inline void nvme_end_req_zoned(struct request *req)
419419
}
420420
}
421421

422+
static inline void __nvme_end_req(struct request *req)
423+
{
424+
nvme_end_req_zoned(req);
425+
nvme_trace_bio_complete(req);
426+
if (req->cmd_flags & REQ_NVME_MPATH)
427+
nvme_mpath_end_request(req);
428+
}
429+
422430
static inline void nvme_end_req(struct request *req)
423431
{
424432
blk_status_t status = nvme_error_status(nvme_req(req)->status);
@@ -429,10 +437,7 @@ static inline void nvme_end_req(struct request *req)
429437
else
430438
nvme_log_error(req);
431439
}
432-
nvme_end_req_zoned(req);
433-
nvme_trace_bio_complete(req);
434-
if (req->cmd_flags & REQ_NVME_MPATH)
435-
nvme_mpath_end_request(req);
440+
__nvme_end_req(req);
436441
blk_mq_end_request(req, status);
437442
}
438443

@@ -492,7 +497,7 @@ void nvme_complete_batch_req(struct request *req)
492497
{
493498
trace_nvme_complete_rq(req);
494499
nvme_cleanup_cmd(req);
495-
nvme_end_req_zoned(req);
500+
__nvme_end_req(req);
496501
}
497502
EXPORT_SYMBOL_GPL(nvme_complete_batch_req);
498503

0 commit comments

Comments
 (0)