svcrdma: do not unregister device for listeners
commit 750037aa0a9f28d84df3dcf319a28423d69092fd upstream.
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 <chuck.lever@oracle.com>
Fixes: c4de97f7c4 ("svcrdma: Handle device removal outside of the CM event handler")
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f3cb81cb96
commit
fbda9cac1b
@@ -621,7 +621,8 @@ static void __svc_rdma_free(struct work_struct *work)
|
||||
/* Destroy the CM ID */
|
||||
rdma_destroy_id(rdma->sc_cm_id);
|
||||
|
||||
rpcrdma_rn_unregister(device, &rdma->sc_rn);
|
||||
if (!test_bit(XPT_LISTENER, &rdma->sc_xprt.xpt_flags))
|
||||
rpcrdma_rn_unregister(device, &rdma->sc_rn);
|
||||
kfree(rdma);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user