Commit 6d92d5d0 authored by Serguei Smirnov's avatar Serguei Smirnov Committed by Oleg Drokin
Browse files

LU-12233 lnet: deadlock on LNet shutdown

Release ln_api_mutex during LNet shutdown while waiting
for zombie LNI to allow other threads to read the LNet
state updated by the shutdown and fall through, avoiding
the deadlock

Lustre-change: https://review.whamcloud.com/39933
Lustre-commit: e0c44564

Signed-off-by: default avatarSerguei Smirnov <ssmirnov@whamcloud.com>
Change-Id: If0886f1bc4412dd9cacb08a0f06fa69aeeed1c5b
Reviewed-on: https://review.whamcloud.com/40171

Tested-by: default avatarjenkins <devops@whamcloud.com>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
Reviewed-by: default avatarChris Horn <chris.horn@hpe.com>
Reviewed-by: default avatarOlaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
parent 877d95b5
......@@ -2002,7 +2002,13 @@ lnet_clear_zombies_nis_locked(struct lnet_net *net)
}
if (!list_empty(&ni->ni_netlist)) {
/* Unlock mutex while waiting to allow other
* threads to read the LNet state and fall through
* to avoid deadlock
*/
lnet_net_unlock(LNET_LOCK_EX);
mutex_unlock(&the_lnet.ln_api_mutex);
++i;
if ((i & (-i)) == i) {
CDEBUG(D_WARNING,
......@@ -2011,6 +2017,8 @@ lnet_clear_zombies_nis_locked(struct lnet_net *net)
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(cfs_time_seconds(1));
mutex_lock(&the_lnet.ln_api_mutex);
lnet_net_lock(LNET_LOCK_EX);
continue;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment