<div dir="ltr">Applied as <a href="https://github.com/LINBIT/drbd/commit/a3807781a29ff488346eed47bd457bbd2cc78c91">https://github.com/LINBIT/drbd/commit/a3807781a29ff488346eed47bd457bbd2cc78c91</a><br><br>Thanks!<br><br>Best regards,<div> Philipp</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Feb 19, 2025 at 4:13 AM zhengbing.huang <<a href="mailto:zhengbing.huang@easystack.cn">zhengbing.huang@easystack.cn</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In testing, we find drbd_transport_rdma module reference count is abnormal:<br>
drbd_transport_rdma 262144 28293<br>
<br>
we don't have that many drbd devices.<br>
<br>
If the XXX_ADDR_ERROR/XXX_ROUTE_ERROR events occurs<br>
and the DSB_CONNECTING flag bit is not set,<br>
the dtr_cma_event_handler() returns 0 directly.<br>
The cm structure cannot be destroyed,<br>
and the drbd_transport_rdma module reference count is abnormal.<br>
<br>
So, for XXX_ADDR_ERROR/XXX_ROUTE_ERROR events,<br>
we do not need to judge the DSB_CONNECTING flag,<br>
and we need to kref_put of cm structure.<br>
<br>
Signed-off-by: zhengbing.huang <<a href="mailto:zhengbing.huang@easystack.cn" target="_blank">zhengbing.huang@easystack.cn</a>><br>
---<br>
drbd/drbd_transport_rdma.c | 5 +++++<br>
1 file changed, 5 insertions(+)<br>
<br>
diff --git a/drbd/drbd_transport_rdma.c b/drbd/drbd_transport_rdma.c<br>
index ba4f1baa7..bb59e6501 100644<br>
--- a/drbd/drbd_transport_rdma.c<br>
+++ b/drbd/drbd_transport_rdma.c<br>
@@ -1292,6 +1292,11 @@ static int dtr_cma_event_handler(struct rdma_cm_id *cm_id, struct rdma_cm_event<br>
// pr_info("%s: RDMA_CM_EVENT_ADDR_ERROR\n", cm->name);<br>
case RDMA_CM_EVENT_ROUTE_ERROR:<br>
// pr_info("%s: RDMA_CM_EVENT_ROUTE_ERROR\n", cm->name);<br>
+ set_bit(DSB_ERROR, &cm->state);<br>
+<br>
+ dtr_cma_retry_connect(cm->path, cm);<br>
+ break;<br>
+<br>
case RDMA_CM_EVENT_CONNECT_ERROR:<br>
// pr_info("%s: RDMA_CM_EVENT_CONNECT_ERROR\n", cm->name);<br>
case RDMA_CM_EVENT_UNREACHABLE:<br>
-- <br>
2.43.0<br>
<br>
</blockquote></div>