Re: [PATCH] rdma: Fix drbd_transport_rdma module reference count exception
Philipp Reisner <[email protected]> Wed, 12 Mar 2025 09:54:03 +0100
| Newsgroups | dev.linux.lists.drbd-dev |
|---|---|
| Message-ID | <CADGDV=XuS-4bkzvEkqJPT+eVy1=KcKsGDftZ-uRoVKBvF1o3tQ@mail.gmail.com> |
Applied as https://github.com/LINBIT/drbd/commit/a3807781a29ff488346eed47bd457bbd2cc78c91 Thanks! Best regards, Philipp On Wed, Feb 19, 2025 at 4:13 AM zhengbing.huang < [email protected]> wrote: > In testing, we find drbd_transport_rdma module reference count is abnormal: > drbd_transport_rdma 262144 28293 > > we don't have that many drbd devices. > > If the XXX_ADDR_ERROR/XXX_ROUTE_ERROR events occurs > and the DSB_CONNECTING flag bit is not set, > the dtr_cma_event_handler() returns 0 directly. > The cm structure cannot be destroyed, > and the drbd_transport_rdma module reference count is abnormal. > > So, for XXX_ADDR_ERROR/XXX_ROUTE_ERROR events, > we do not need to judge the DSB_CONNECTING flag, > and we need to kref_put of cm structure. > > Signed-off-by: zhengbing.huang <[email protected]> > --- > drbd/drbd_transport_rdma.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drbd/drbd_transport_rdma.c b/drbd/drbd_transport_rdma.c > index ba4f1baa7..bb59e6501 100644 > --- a/drbd/drbd_transport_rdma.c > +++ b/drbd/drbd_transport_rdma.c > @@ -1292,6 +1292,11 @@ static int dtr_cma_event_handler(struct rdma_cm_id > *cm_id, struct rdma_cm_event > // pr_info("%s: RDMA_CM_EVENT_ADDR_ERROR\n", cm->name); > case RDMA_CM_EVENT_ROUTE_ERROR: > // pr_info("%s: RDMA_CM_EVENT_ROUTE_ERROR\n", cm->name); > + set_bit(DSB_ERROR, &cm->state); > + > + dtr_cma_retry_connect(cm->path, cm); > + break; > + > case RDMA_CM_EVENT_CONNECT_ERROR: > // pr_info("%s: RDMA_CM_EVENT_CONNECT_ERROR\n", cm->name); > case RDMA_CM_EVENT_UNREACHABLE: > -- > 2.43.0 > >