From 016029d97a8af446452b9934f4a01d4ea800ea7e Mon Sep 17 00:00:00 2001 From: Serguei Smirnov Date: Wed, 17 Mar 2021 20:52:16 -0700 Subject: [PATCH] LU-14503 o2iblnd: clean up zombie connections on shutdown This is a test patch created to verify the fix for cleaning up zombie connections on net shutdown in o2iblnd. Wake up connd threads and wait for them to do the clean-up before proceeding. Test-Parameters: trivial Signed-off-by: Serguei Smirnov Change-Id: Iff8424d9be7401987046fe9aef6e7a787f5efe83 --- lnet/klnds/o2iblnd/o2iblnd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 85d37b7..bfec2a5 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -3021,6 +3021,13 @@ 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