Skip to content

Commit 750037a

Browse files
Olga Kornievskaiachucklever
authored andcommitted
svcrdma: do not unregister device for listeners
On an rdma-capable machine, a start/stop/start and then on a stop of a knfsd server would lead kref underflow warning because svc_rdma_free would indiscriminately unregister the rdma device but a listening transport never calls the rdma_rn_register() thus leading to kref going down to 0 on the 1st stop of the server and on the 2nd stop it leads to a problem. Suggested-by: Chuck Lever <[email protected]> Fixes: c4de97f ("svcrdma: Handle device removal outside of the CM event handler") Signed-off-by: Olga Kornievskaia <[email protected]> Cc: [email protected] Signed-off-by: Chuck Lever <[email protected]>
1 parent 930b64c commit 750037a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/sunrpc/xprtrdma/svc_rdma_transport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ static void __svc_rdma_free(struct work_struct *work)
621621
/* Destroy the CM ID */
622622
rdma_destroy_id(rdma->sc_cm_id);
623623

624-
rpcrdma_rn_unregister(device, &rdma->sc_rn);
624+
if (!test_bit(XPT_LISTENER, &rdma->sc_xprt.xpt_flags))
625+
rpcrdma_rn_unregister(device, &rdma->sc_rn);
625626
kfree(rdma);
626627
}
627628

0 commit comments

Comments
 (0)