summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-07-01 00:12:35 +0000
committerAnand Avati <avati@gluster.com>2011-07-01 01:26:21 -0700
commitac683df2322123472ba52dbeecb9cd5512ecc58c (patch)
tree77bf211c29a30e08f9ba9c30ee6a8831cd72ed2b /xlators
parenta21c3bb99e5ad59e8e9ec0a050ce8617ce3fe167 (diff)
mnt/fuse: Do a pthread_cond_broadcast for both CHILD_UP and CHILD_DOWN events.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3091 (rebalance fails with "transport endpoint not connected" in 3.2.1 rdma set-up) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3091
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c11
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 875b89fb953..70078286fdd 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3039,7 +3039,7 @@ fuse_graph_sync (xlator_t *this)
priv->next_graph = NULL;
need_first_lookup = 1;
- while (!priv->child_up) {
+ while (!priv->event_recvd) {
ret = pthread_cond_wait (&priv->sync_cond,
&priv->sync_mutex);
if (ret != 0) {
@@ -3301,7 +3301,7 @@ fuse_graph_setup (xlator_t *this, glusterfs_graph_t *graph)
pthread_mutex_lock (&priv->sync_mutex);
{
priv->next_graph = graph;
- priv->child_up = 0;
+ priv->event_recvd = 0;
pthread_cond_signal (&priv->sync_cond);
}
@@ -3344,10 +3344,11 @@ notify (xlator_t *this, int32_t event, void *data, ...)
"failed to setup the graph");
}
- if (event == GF_EVENT_CHILD_UP) {
+ if ((event == GF_EVENT_CHILD_UP)
+ || (event == GF_EVENT_CHILD_DOWN)) {
pthread_mutex_lock (&private->sync_mutex);
{
- private->child_up = 1;
+ private->event_recvd = 1;
pthread_cond_broadcast (&private->sync_cond);
}
pthread_mutex_unlock (&private->sync_mutex);
@@ -3647,7 +3648,7 @@ init (xlator_t *this_xl)
pthread_mutex_init (&priv->fuse_dump_mutex, NULL);
pthread_cond_init (&priv->sync_cond, NULL);
pthread_mutex_init (&priv->sync_mutex, NULL);
- priv->child_up = 0;
+ priv->event_recvd = 0;
for (i = 0; i < FUSE_OP_HIGH; i++) {
if (!fuse_std_ops[i])
diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h
index 98f0005937b..b1e7637c1a2 100644
--- a/xlators/mount/fuse/src/fuse-bridge.h
+++ b/xlators/mount/fuse/src/fuse-bridge.h
@@ -91,7 +91,7 @@ struct fuse_private {
pthread_cond_t sync_cond;
pthread_mutex_t sync_mutex;
- char child_up;
+ char event_recvd;
char init_recvd;