From 171973d18d22e4f0f4117656c188d395bf3ac8a5 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 7 Sep 2010 12:59:07 +0000 Subject: in case of failures, don't hang fuse mount Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1527 (mount time defunct window with remote volumes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1527 --- xlators/mount/fuse/src/fuse-bridge.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 4de9685d1..18a4d7aee 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -3290,6 +3290,30 @@ notify (xlator_t *this, int32_t event, void *data, ...) break; 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); + if (ret) + gf_log (this->name, GF_LOG_WARNING, + "failed to setup the graph"); + } + + break; + } case GF_EVENT_CHILD_UP: { /* set priv->active_subvol */ @@ -3297,7 +3321,8 @@ notify (xlator_t *this, int32_t event, void *data, ...) graph = data; ret = fuse_graph_setup (this, graph); if (ret) - break; + gf_log (this->name, GF_LOG_WARNING, + "failed to setup the graph"); if (!private->fuse_thread_started) { private->fuse_thread_started = 1; -- cgit