From d5dd69dc2045fefb3f407689535a09a115206e4c Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Sat, 24 Jul 2010 13:36:46 +0000 Subject: make glusterfs work with autofs5 autofs5 blocks all processes which try to access the fs, except for the one spawned by it (which one is expected to perform the mount). Therefore our autofs4 workaround -- after daemonization, original process waits for mounting to happen before exit -- does not work anymore. We need to do the mount in the original process itself. So we split glusterfs_graph_init() and move the fuse related part before daemonization. Signed-off-by: Csaba Henk Signed-off-by: Anand V. Avati BUG: 1043 (autofs access hangs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1043 --- glusterfsd/src/glusterfsd.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index bf0d092b0..3751a7c8e 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -640,7 +640,7 @@ glusterfs_graph_parent_up (xlator_t *graph) } int -glusterfs_graph_init (xlator_t *graph, int fuse) +glusterfs_graph_init_fuse (xlator_t *graph, int fuse) { volume_opt_list_t *vol_opt = NULL; @@ -661,6 +661,13 @@ glusterfs_graph_init (xlator_t *graph, int fuse) graph->ready = 1; } + + return 0; +} + +int +glusterfs_graph_init (xlator_t *graph) +{ if (_xlator_graph_init (graph) == -1) return -1; @@ -1305,6 +1312,18 @@ main (int argc, char *argv[]) gf_log ("glusterfs", GF_LOG_ERROR, "exiting"); return -1; } + fuse_volume_found = 1; + } + + /* override xlator options with command line options + * where applicable + */ + gf_add_cmdline_options (graph, cmd_args); + + if (glusterfs_graph_init_fuse (graph, fuse_volume_found) != 0) { + gf_log ("glusterfs", GF_LOG_ERROR, + "fuse translator initialization failed. exiting"); + return -1; } /* daemonize now */ @@ -1384,13 +1403,8 @@ main (int argc, char *argv[]) gf_timer_registry_init (ctx); - /* override xlator options with command line options - * where applicable - */ - gf_add_cmdline_options (graph, cmd_args); - ctx->graph = graph; - if (glusterfs_graph_init (graph, fuse_volume_found) != 0) { + if (glusterfs_graph_init (graph) != 0) { gf_log ("glusterfs", GF_LOG_ERROR, "translator initialization failed. exiting"); if (!cmd_args->no_daemon_mode && -- cgit