Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-12537 lnet: Sync the start of discovery and monitor threads
[fs/lustre-release.git]
/
lnet
/
lnet
/
peer.c
diff --git
a/lnet/lnet/peer.c
b/lnet/lnet/peer.c
index
8e3f8f6
..
43c8d35
100644
(file)
--- a/
lnet/lnet/peer.c
+++ b/
lnet/lnet/peer.c
@@
-3276,6
+3276,8
@@
static int lnet_peer_discovery(void *arg)
struct lnet_peer *lp;
int rc;
struct lnet_peer *lp;
int rc;
+ wait_for_completion(&the_lnet.ln_started);
+
CDEBUG(D_NET, "started\n");
cfs_block_allsigs();
CDEBUG(D_NET, "started\n");
cfs_block_allsigs();
@@
-3448,7
+3450,14
@@
void lnet_peer_discovery_stop(void)
LASSERT(the_lnet.ln_dc_state == LNET_DC_STATE_RUNNING);
the_lnet.ln_dc_state = LNET_DC_STATE_STOPPING;
LASSERT(the_lnet.ln_dc_state == LNET_DC_STATE_RUNNING);
the_lnet.ln_dc_state = LNET_DC_STATE_STOPPING;
- wake_up(&the_lnet.ln_dc_waitq);
+
+ /* In the LNetNIInit() path we may be stopping discovery before it
+ * entered its work loop
+ */
+ if (!completion_done(&the_lnet.ln_started))
+ complete(&the_lnet.ln_started);
+ else
+ wake_up(&the_lnet.ln_dc_waitq);
wait_event(the_lnet.ln_dc_waitq,
the_lnet.ln_dc_state == LNET_DC_STATE_SHUTDOWN);
wait_event(the_lnet.ln_dc_waitq,
the_lnet.ln_dc_state == LNET_DC_STATE_SHUTDOWN);