Whamcloud - gitweb
LU-15616 lnet: ln_api_mutex deadlocks
[fs/lustre-release.git] / lnet / lnet / lib-move.c
index 34873e8..9aae6ac 100644 (file)
@@ -4134,7 +4134,9 @@ void lnet_monitor_thr_stop(void)
        complete(&the_lnet.ln_mt_wait_complete);
 
        /* block until monitor thread signals that it's done */
        complete(&the_lnet.ln_mt_wait_complete);
 
        /* block until monitor thread signals that it's done */
+       mutex_unlock(&the_lnet.ln_api_mutex);
        down(&the_lnet.ln_mt_signal);
        down(&the_lnet.ln_mt_signal);
+       mutex_lock(&the_lnet.ln_api_mutex);
        LASSERT(the_lnet.ln_mt_state == LNET_MT_STATE_SHUTDOWN);
 
        /* perform cleanup tasks */
        LASSERT(the_lnet.ln_mt_state == LNET_MT_STATE_SHUTDOWN);
 
        /* perform cleanup tasks */