Skip to content

Commit a2e4c5f

Browse files
committed
nvme-multipath: fix io accounting on failover
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 <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 2fe7b42 commit a2e4c5f

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
@@ -422,7 +422,7 @@ static inline void __nvme_end_req(struct request *req)
422422
nvme_mpath_end_request(req);
423423
}
424424

425-
static inline void nvme_end_req(struct request *req)
425+
void nvme_end_req(struct request *req)
426426
{
427427
blk_status_t status = nvme_error_status(nvme_req(req)->status);
428428

drivers/nvme/host/multipath.c

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

121-
blk_mq_end_request(req, 0);
121+
nvme_req(req)->status = 0;
122+
nvme_end_req(req);
122123
kblockd_schedule_work(&ns->head->requeue_work);
123124
}
124125

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)