Skip to content

Commit 645cba2

Browse files
committed
nvme-multipath: fix io accounting on failover
jira LE-2015 Rebuild_History Non-Buildable kernel-5.14.0-427.42.1.el9_4 commit-author Keith Busch <kbusch@kernel.org> commit a2e4c5f Empty-Commit: Cherry-Pick Conflicts during history rebuild. Will be included in final tarball splat. Ref for failed cherry-pick at: ciq/ciq_backports/kernel-5.14.0-427.42.1.el9_4/a2e4c5f5.failed 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> # Conflicts: # drivers/nvme/host/nvme.h
1 parent 2517b7b commit 645cba2

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
nvme-multipath: fix io accounting on failover
2+
3+
jira LE-2015
4+
Rebuild_History Non-Buildable kernel-5.14.0-427.42.1.el9_4
5+
commit-author Keith Busch <kbusch@kernel.org>
6+
commit a2e4c5f5f68dbd206f132bc709b98dea64afc3b8
7+
Empty-Commit: Cherry-Pick Conflicts during history rebuild.
8+
Will be included in final tarball splat. Ref for failed cherry-pick at:
9+
ciq/ciq_backports/kernel-5.14.0-427.42.1.el9_4/a2e4c5f5.failed
10+
11+
There are io stats accounting that needs to be handled, so don't call
12+
blk_mq_end_request() directly. Use the existing nvme_end_req() helper
13+
that already handles everything.
14+
15+
Fixes: d4d957b53d91ee ("nvme-multipath: support io stats on the mpath device")
16+
Reviewed-by: Christoph Hellwig <hch@lst.de>
17+
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
18+
Signed-off-by: Keith Busch <kbusch@kernel.org>
19+
(cherry picked from commit a2e4c5f5f68dbd206f132bc709b98dea64afc3b8)
20+
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
21+
22+
# Conflicts:
23+
# drivers/nvme/host/nvme.h
24+
diff --cc drivers/nvme/host/nvme.h
25+
index a7b00be1e451,fc31bd340a63..000000000000
26+
--- a/drivers/nvme/host/nvme.h
27+
+++ b/drivers/nvme/host/nvme.h
28+
@@@ -722,6 -746,28 +722,31 @@@ static inline bool nvme_is_aen_req(u16
29+
nvme_tag_from_cid(command_id) >= NVME_AQ_BLK_MQ_DEPTH;
30+
}
31+
32+
++<<<<<<< HEAD
33+
++=======
34+
+ /*
35+
+ * Returns true for sink states that can't ever transition back to live.
36+
+ */
37+
+ static inline bool nvme_state_terminal(struct nvme_ctrl *ctrl)
38+
+ {
39+
+ switch (nvme_ctrl_state(ctrl)) {
40+
+ case NVME_CTRL_NEW:
41+
+ case NVME_CTRL_LIVE:
42+
+ case NVME_CTRL_RESETTING:
43+
+ case NVME_CTRL_CONNECTING:
44+
+ return false;
45+
+ case NVME_CTRL_DELETING:
46+
+ case NVME_CTRL_DELETING_NOIO:
47+
+ case NVME_CTRL_DEAD:
48+
+ return true;
49+
+ default:
50+
+ WARN_ONCE(1, "Unhandled ctrl state:%d", ctrl->state);
51+
+ return true;
52+
+ }
53+
+ }
54+
+
55+
+ void nvme_end_req(struct request *req);
56+
++>>>>>>> a2e4c5f5f68d (nvme-multipath: fix io accounting on failover)
57+
void nvme_complete_rq(struct request *req);
58+
void nvme_complete_batch_req(struct request *req);
59+
60+
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
61+
index 93dd6cfe54ab..9b4c0a3de0b2 100644
62+
--- a/drivers/nvme/host/core.c
63+
+++ b/drivers/nvme/host/core.c
64+
@@ -382,7 +382,7 @@ static inline void nvme_end_req_zoned(struct request *req)
65+
le64_to_cpu(nvme_req(req)->result.u64));
66+
}
67+
68+
-static inline void nvme_end_req(struct request *req)
69+
+void nvme_end_req(struct request *req)
70+
{
71+
blk_status_t status = nvme_error_status(nvme_req(req)->status);
72+
73+
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
74+
index 2adfdb3a135f..a5e6d7f4088c 100644
75+
--- a/drivers/nvme/host/multipath.c
76+
+++ b/drivers/nvme/host/multipath.c
77+
@@ -124,7 +124,8 @@ void nvme_failover_req(struct request *req)
78+
blk_steal_bios(&ns->head->requeue_list, req);
79+
spin_unlock_irqrestore(&ns->head->requeue_lock, flags);
80+
81+
- blk_mq_end_request(req, 0);
82+
+ nvme_req(req)->status = 0;
83+
+ nvme_end_req(req);
84+
kblockd_schedule_work(&ns->head->requeue_work);
85+
}
86+
87+
* Unmerged path drivers/nvme/host/nvme.h

0 commit comments

Comments
 (0)