From fdc016fabed01e8497ffe281d7f35708b0eb25cd Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 27 Aug 2010 09:28:37 +0000 Subject: fix notify mechanism to send CHILD_UP to fuse Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur --- libglusterfs/src/defaults.c | 16 +++++++++++++++- xlators/mount/fuse/src/fuse-bridge.c | 4 ++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c index f5431d471df..f5317cf8648 100644 --- a/libglusterfs/src/defaults.c +++ b/libglusterfs/src/defaults.c @@ -1236,8 +1236,22 @@ default_notify (xlator_t *this, int32_t event, void *data, ...) } } break; - case GF_EVENT_CHILD_DOWN: case GF_EVENT_CHILD_UP: + { + xlator_list_t *parent = this->parents; + /* Handle the case of CHILD_UP specially, send it to fuse */ + if (!parent && this->ctx && this->ctx->master) + xlator_notify (this->ctx->master, event, this->graph, NULL); + + while (parent) { + if (parent->xlator->init_succeeded) + xlator_notify (parent->xlator, event, + this, NULL); + parent = parent->next; + } + } + break; + case GF_EVENT_CHILD_DOWN: default: { xlator_list_t *parent = this->parents; diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index c4452555c75..ef433d0a046 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -3245,6 +3245,10 @@ fuse_graph_setup (xlator_t *this, glusterfs_graph_t *graph) priv = this->private; + /* handle the case of more than one CHILD_UP on same graph */ + if (priv->active_subvol == graph->top) + return -1; + itable = inode_table_new (0, graph->top); if (!itable) return -1; -- cgit