Skip to content

Commit 6aafa19

Browse files
committed
nvme-multipath: fix io accounting on failover
jira LE-2157 Rebuild_History Non-Buildable kernel-5.14.0-503.14.1.el9_5 commit-author Keith Busch <kbusch@kernel.org> commit a2e4c5f There are io stats accounting that needs to be handled, so don't call blk_mq_end_request() directly. Use the existing nvme_end_req() helper that already handles everything. 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> Signed-off-by: Keith Busch <kbusch@kernel.org> (cherry picked from commit a2e4c5f) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 442e44d commit 6aafa19

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

drivers/nvme/host/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static inline void __nvme_end_req(struct request *req)
427427
nvme_mpath_end_request(req);
428428
}
429429

430-
static inline void nvme_end_req(struct request *req)
430+
void nvme_end_req(struct request *req)
431431
{
432432
blk_status_t status = nvme_error_status(nvme_req(req)->status);
433433

drivers/nvme/host/multipath.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ void nvme_failover_req(struct request *req)
127127
blk_steal_bios(&ns->head->requeue_list, req);
128128
spin_unlock_irqrestore(&ns->head->requeue_lock, flags);
129129

130-
blk_mq_end_request(req, 0);
130+
nvme_req(req)->status = 0;
131+
nvme_end_req(req);
131132
kblockd_schedule_work(&ns->head->requeue_work);
132133
}
133134

drivers/nvme/host/nvme.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ static inline bool nvme_state_terminal(struct nvme_ctrl *ctrl)
767767
}
768768
}
769769

770+
void nvme_end_req(struct request *req);
770771
void nvme_complete_rq(struct request *req);
771772
void nvme_complete_batch_req(struct request *req);
772773

0 commit comments

Comments
 (0)