summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-02-22 05:00:37 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-22 09:21:47 -0800
commit46279693027230d5454ad98c267d93d5139e19af (patch)
tree3bd596d4c4f68f8a74ca6218526c493c70ac8c5f /xlators/mount/fuse
parentd437dd91bf167675615d7c7c2f99abbed2d899a1 (diff)
send the CHILD_DOWN event also to fuse
and start the fuse thread in CHILD_DOWN event too. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2005 (Mounting Gluster volume with RO bricks hangs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2005
Diffstat (limited to 'xlators/mount/fuse')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c42
1 files changed, 11 insertions, 31 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index affa37d5b31..f988c0102ce 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3324,21 +3324,10 @@ notify (xlator_t *this, int32_t event, void *data, ...)
break;
+ case GF_EVENT_CHILD_UP:
+ case GF_EVENT_CHILD_DOWN:
case GF_EVENT_CHILD_CONNECTING:
{
- if (!private->fuse_thread_started) {
- private->fuse_thread_started = 1;
-
- ret = pthread_create (&private->fuse_thread, NULL,
- fuse_thread_proc, this);
- if (ret != 0) {
- gf_log (this->name, GF_LOG_DEBUG,
- "pthread_create() failed (%s)",
- strerror (errno));
- break;
- }
- }
-
if (data) {
graph = data;
ret = fuse_graph_setup (this, graph);
@@ -3347,17 +3336,15 @@ notify (xlator_t *this, int32_t event, void *data, ...)
"failed to setup the graph");
}
- break;
- }
- case GF_EVENT_CHILD_UP:
- {
- /* set priv->active_subvol */
- /* set priv->first_lookup = 1 */
- graph = data;
- ret = fuse_graph_setup (this, graph);
- if (ret)
- gf_log (this->name, GF_LOG_WARNING,
- "failed to setup the graph");
+ if (event == GF_EVENT_CHILD_UP) {
+
+ pthread_mutex_lock (&private->sync_mutex);
+ {
+ private->child_up = 1;
+ pthread_cond_broadcast (&private->sync_cond);
+ }
+ pthread_mutex_unlock (&private->sync_mutex);
+ }
if (!private->fuse_thread_started) {
private->fuse_thread_started = 1;
@@ -3372,13 +3359,6 @@ notify (xlator_t *this, int32_t event, void *data, ...)
}
}
- pthread_mutex_lock (&private->sync_mutex);
- {
- private->child_up = 1;
- pthread_cond_broadcast (&private->sync_cond);
- }
- pthread_mutex_unlock (&private->sync_mutex);
-
break;
}