diff options
author | Amar Tumballi <amar@gluster.com> | 2011-03-18 00:56:14 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-18 20:36:39 -0700 |
commit | bb5b31fb96dbc2092e2967924462c59863845749 (patch) | |
tree | e54a0ac9c59715b9da305326dac5225d3b33f13e /xlators/mount | |
parent | 26dcbc729395b00dae45cd62222aaccbd2ab7aff (diff) |
fuse: set 'graph->used' after graph change
Because in the current way, we have chances of changing the graph
to old one too. with this, we can control this.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 2503 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2503
Diffstat (limited to 'xlators/mount')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index f4e142f05..eb0ef9efd 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -3292,6 +3292,11 @@ fuse_graph_setup (xlator_t *this, glusterfs_graph_t *graph) if (priv->active_subvol == graph->top) return 0; /* This is a valid case */ + if (graph->used) + return 0; + + graph->used = 1; + itable = inode_table_new (0, graph->top); if (!itable) return -1; @@ -3307,6 +3312,9 @@ fuse_graph_setup (xlator_t *this, glusterfs_graph_t *graph) } pthread_mutex_unlock (&priv->sync_mutex); + gf_log ("fuse", GF_LOG_INFO, "switched to graph %d", + ((graph) ? graph->id : 0)); + return ret; } @@ -3320,20 +3328,21 @@ notify (xlator_t *this, int32_t event, void *data, ...) private = this->private; + graph = data; + + gf_log ("fuse", GF_LOG_DEBUG, "got event %d on graph %d", + event, ((graph) ? graph->id : 0)); + switch (event) { case GF_EVENT_GRAPH_NEW: - graph = data; - /* TODO: */ - break; case GF_EVENT_CHILD_UP: case GF_EVENT_CHILD_DOWN: case GF_EVENT_CHILD_CONNECTING: { - if (data) { - graph = data; + if (graph) { ret = fuse_graph_setup (this, graph); if (ret) gf_log (this->name, GF_LOG_WARNING, @@ -3341,7 +3350,6 @@ notify (xlator_t *this, int32_t event, void *data, ...) } if (event == GF_EVENT_CHILD_UP) { - pthread_mutex_lock (&private->sync_mutex); { private->child_up = 1; |