summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-01-23 05:13:24 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-01-23 02:58:31 -0800
commit9c53d5daf403f6fbfde76dec121295a4c156b32e (patch)
treea8ebba8bfcb709522f0e66500a7062ef7f001ad1 /glusterfsd/src/glusterfsd.c
parent95dba6f085379ce8e07f316bc92c479956b5b221 (diff)
core: fix initialization of disjoint xlator graph
if graph has disjoint subgraphs, send GF_EVENT_PARENT_UP to every top node Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 272 (Server backend storage hang should not cause the mount point to hang) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=272
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index d3f1be02867..14627f0af94 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -607,6 +607,31 @@ _xlator_graph_init (xlator_t *xl)
}
int
+glusterfs_graph_parent_up (xlator_t *graph)
+{
+ xlator_t *trav = NULL;
+ int ret = -1;
+
+ trav = graph;
+
+ while (trav->prev)
+ trav = trav->prev;
+
+ while (trav) {
+ if (!xlator_has_parent (trav)) {
+ ret = trav->notify (trav, GF_EVENT_PARENT_UP, trav);
+ }
+
+ if (ret)
+ break;
+
+ trav = trav->next;
+ }
+
+ return ret;
+}
+
+int
glusterfs_graph_init (xlator_t *graph, int fuse)
{
volume_opt_list_t *vol_opt = NULL;
@@ -1366,7 +1391,7 @@ main (int argc, char *argv[])
}
/* Send PARENT_UP notify to all the translators now */
- graph->notify (graph, GF_EVENT_PARENT_UP, ctx->graph);
+ glusterfs_graph_parent_up (graph);
gf_log ("glusterfs", GF_LOG_NORMAL, "Successfully started");