Whamcloud - gitweb
LU-12254 lnet: correct discovery LNetEQFree() 36/36036/5
authorAmir Shehata <ashehata@whamcloud.com>
Tue, 30 Apr 2019 18:51:09 +0000 (11:51 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Oct 2019 20:30:47 +0000 (20:30 +0000)
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.

Lustre-change: https://review.whamcloud.com/34796
Lustre-commit: a0879b5985b41f92dede96e7f27623eb72102b15

Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: Ie38ec25e09bf6d7cf2aadc30edd91d298897c51b
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36036
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/peer.c

index 69a9e93..4c1a499 100644 (file)
@@ -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);