Whamcloud - gitweb
LU-14503 o2iblnd: clean up zombie connections on shutdown 68/42068/6
authorSerguei Smirnov <ssmirnov@whamcloud.com>
Thu, 18 Mar 2021 03:52:16 +0000 (20:52 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Jun 2022 05:30:38 +0000 (05:30 +0000)
Clean 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 <ssmirnov@whamcloud.com>
Change-Id: Iff8424d9be7401987046fe9aef6e7a787f5efe83
Reviewed-on: https://review.whamcloud.com/42068
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd.c

index 2b1272a..a20e772 100644 (file)
@@ -3056,6 +3056,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_nidstr(&ni->ni_nid),
+                                      atomic_read(&net->ibn_nconns));
                fallthrough;
 
         case IBLND_INIT_NOTHING: