From: Chris Horn Date: Fri, 21 Feb 2020 00:01:45 +0000 (-0600) Subject: LU-13277 lnet: Discovery thread can deadlock on shutdown X-Git-Tag: 2.13.53~117 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=82bb93410fc6f74e32ad74339ece5b4f62dc9967 LU-13277 lnet: Discovery thread can deadlock on shutdown Drop the net_lock/EX before breaking out of the loop to avoid deadlock. Cray-bug-id: LUS-8525 Signed-off-by: Chris Horn Change-Id: Ie62b55fa45b5795937eb1480a1fcabe295fed0ee Reviewed-on: https://review.whamcloud.com/37675 Reviewed-by: Amir Shehata Tested-by: jenkins Reviewed-by: Serguei Smirnov Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index 5ea9206..fe4f028 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -3291,8 +3291,10 @@ static int lnet_peer_discovery(void *arg) lnet_push_target_resize(); lnet_net_lock(LNET_LOCK_EX); - if (the_lnet.ln_dc_state == LNET_DC_STATE_STOPPING) + if (the_lnet.ln_dc_state == LNET_DC_STATE_STOPPING) { + lnet_net_unlock(LNET_LOCK_EX); break; + } /* * Process all incoming discovery work requests. When