From e0cd2047659204c310aaa8690aaa13576012a177 Mon Sep 17 00:00:00 2001 From: Serguei Smirnov Date: Wed, 17 Mar 2021 21:00:28 -0700 Subject: [PATCH] LU-14503 o2iblnd: clean up zombie connections on shutdown Clean up zombie connections on net shutdown in o2iblnd. Wake up connd threads and wait for them to do the clean-up before proceeding. Lustre-change: https://review.whamcloud.com/42068 Lustre-commit: 016029d97a8af446452b9934f4a01d4ea800ea7e Test-Parameters: trivial Signed-off-by: Serguei Smirnov Change-Id: Ib094e2f480077034e78fe90e2aec9b1349f7e708 Reviewed-on: https://review.whamcloud.com/42069 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Amir Shehata Reviewed-by: Andreas Dilger --- lnet/klnds/o2iblnd/o2iblnd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index e46ebd7..9f9cba3 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -3037,6 +3037,12 @@ kiblnd_shutdown(struct lnet_ni *ni) list_del(&net->ibn_list); write_unlock_irqrestore(g_lock, flags); + wake_up_all(&kiblnd_data.kib_connd_waitq); + wait_var_event_warning(&net->ibn_nconns, + atomic_read(&net->ibn_nconns) == 0, + "%s: waiting for %d conns to clean\n", + libcfs_nid2str(ni->ni_nid), + atomic_read(&net->ibn_nconns)); /* fall through */ case IBLND_INIT_NOTHING: -- 1.8.3.1