summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glusterfsd/src/glusterfsd.c14
-rw-r--r--libglusterfs/src/glusterfs.h1
2 files changed, 12 insertions, 3 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index b5d6bd61fb0..35cb286ea0f 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -78,6 +78,10 @@
#include "daemon.h"
+/* process mode definitions */
+#define GF_SERVER_PROCESS 0
+#define GF_CLIENT_PROCESS 1
+#define GF_GLUSTERD_PROCESS 2
/* using argp for command line parsing */
static char gf_doc[] = "";
@@ -201,6 +205,12 @@ create_fuse_mount (glusterfs_ctx_t *ctx)
return 0;
}
+ if (ctx->process_mode != GF_CLIENT_PROCESS) {
+ gf_log("glusterfsd", GF_LOG_ERROR,
+ "Not a client process, not performing mount operation");
+ return -1;
+ }
+
master = GF_CALLOC (1, sizeof (*master),
gfd_mt_xlator_t);
if (!master)
@@ -834,9 +844,6 @@ generate_uuid ()
return gf_strdup (tmp_str);
}
-#define GF_SERVER_PROCESS 0
-#define GF_CLIENT_PROCESS 1
-#define GF_GLUSTERD_PROCESS 2
static uint8_t
gf_get_process_mode (char *exec_name)
@@ -1073,6 +1080,7 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx)
}
process_mode = gf_get_process_mode (argv[0]);
+ ctx->process_mode = process_mode;
/* Make sure after the parsing cli, if '--volfile-server' option is
given, then '--volfile-id' is mandatory */
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 78af68c0081..c746cfe023b 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -343,6 +343,7 @@ struct _glusterfs_ctx {
indicate how many times the graph has
got changed */
pid_t mtab_pid; /* pid of the process which updates the mtab */
+ int process_mode; /*mode in which process is runninng*/
};
typedef struct _glusterfs_ctx glusterfs_ctx_t;