From a0879b5985b41f92dede96e7f27623eb72102b15 Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Tue, 30 Apr 2019 11:51:09 -0700 Subject: [PATCH] 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 --- lnet/lnet/peer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 1.8.3.1