From: Amir Shehata Date: Tue, 30 Apr 2019 18:51:09 +0000 (-0700) Subject: LU-12254 lnet: correct discovery LNetEQFree() X-Git-Tag: 2.12.55~25^2~34 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=a0879b5985b41f92dede96e7f27623eb72102b15;p=fs%2Flustre-release.git LU-12254 lnet: correct discovery LNetEQFree() The EQ needs to be freed after all the queues are cleaned to avoid having non-processed events on the event queue on free. This will prevent the memory from being freed. Test-Parameters: forbuildonly Signed-off-by: Amir Shehata Change-Id: Ie38ec25e09bf6d7cf2aadc30edd91d298897c51b Reviewed-on: https://review.whamcloud.com/34796 Reviewed-by: Olaf Weber Reviewed-by: Sebastien Buisson Reviewed-by: Chris Horn Tested-by: Jenkins --- diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index 69a9e93..4c1a499 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -3154,8 +3154,6 @@ static int lnet_peer_discovery(void *arg) * size of the thundering herd if there are multiple threads * waiting on discovery of a single peer. */ - LNetEQFree(the_lnet.ln_dc_eqh); - LNetInvalidateEQHandle(&the_lnet.ln_dc_eqh); /* Queue cleanup 1: stop all pending pings and pushes. */ lnet_net_lock(LNET_LOCK_EX); @@ -3183,6 +3181,9 @@ static int lnet_peer_discovery(void *arg) } lnet_net_unlock(LNET_LOCK_EX); + LNetEQFree(the_lnet.ln_dc_eqh); + LNetInvalidateEQHandle(&the_lnet.ln_dc_eqh); + the_lnet.ln_dc_state = LNET_DC_STATE_SHUTDOWN; wake_up(&the_lnet.ln_dc_waitq);