Whamcloud - gitweb
LU-13277 lnet: Discovery thread can deadlock on shutdown 75/37675/2
authorChris Horn <hornc@cray.com>
Fri, 21 Feb 2020 00:01:45 +0000 (18:01 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 5 Mar 2020 22:36:55 +0000 (22:36 +0000)
Drop the net_lock/EX before breaking out of the loop to avoid
deadlock.

Cray-bug-id: LUS-8525
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Ie62b55fa45b5795937eb1480a1fcabe295fed0ee
Reviewed-on: https://review.whamcloud.com/37675
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/peer.c

index 5ea9206..fe4f028 100644 (file)
@@ -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