Commit 526cdb4f authored by Liang Zhen's avatar Liang Zhen Committed by Greg Kroah-Hartman

staging/lustre/lnet: NI shutdown may loop forever

lnet_shutdown_lndnis() may enter endless loop if there is a busy NI,
this is injected by LNet SMP improvements. It's fixed in this patch.
Signed-off-by: default avatarLiang Zhen <liang.zhen@intel.com>
Reviewed-on: http://review.whamcloud.com/9706
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4780Reviewed-by: default avatarIsaac Huang <he.huang@intel.com>
Reviewed-by: default avatarBobi Jam <bobijam@gmail.com>
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 16e9f6d4
...@@ -986,12 +986,11 @@ lnet_shutdown_lndnis (void) ...@@ -986,12 +986,11 @@ lnet_shutdown_lndnis (void)
break; break;
} }
while (!list_empty(&ni->ni_list)) { if (!list_empty(&ni->ni_list)) {
lnet_net_unlock(LNET_LOCK_EX); lnet_net_unlock(LNET_LOCK_EX);
++i; ++i;
if ((i & (-i)) == i) { if ((i & (-i)) == i) {
CDEBUG(D_WARNING, CDEBUG(D_WARNING, "Waiting for zombie LNI %s\n",
"Waiting for zombie LNI %s\n",
libcfs_nid2str(ni->ni_nid)); libcfs_nid2str(ni->ni_nid));
} }
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
...@@ -1016,6 +1015,8 @@ lnet_shutdown_lndnis (void) ...@@ -1016,6 +1015,8 @@ lnet_shutdown_lndnis (void)
libcfs_nid2str(ni->ni_nid)); libcfs_nid2str(ni->ni_nid));
lnet_ni_free(ni); lnet_ni_free(ni);
i = 2;
lnet_net_lock(LNET_LOCK_EX); lnet_net_lock(LNET_LOCK_EX);
} }
......
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