From 17e57f27c714c94dd5d9fa91650f83d069f2f4e4 Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Mon, 12 Sep 2011 15:51:42 +0530 Subject: mgmt/glusterd: check the availability of fuse for few glusterd operations Change-Id: I410cc6a86c32637566e5498f69f46cb40322e7fb BUG: 2715 Reviewed-on: http://review.gluster.com/364 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 86681146b..6dca708f7 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -942,6 +942,7 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr) gf_boolean_t exists = _gf_false; glusterd_volinfo_t *volinfo = NULL; char errmsg[PATH_MAX] = {0,}; + dict_t *ctx = NULL; ret = dict_get_int32 (dict, "type", &type); @@ -981,7 +982,24 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr) case GF_GSYNC_OPTION_TYPE_START: ret = glusterd_op_verify_gsync_start_options (volinfo, slave, op_errstr); + if (ret) + goto out; + ctx = glusterd_op_get_ctx(); + if (ctx) { + /*gsyncd does a fuse mount to start the geo-rep session*/ + if (!glusterd_is_fuse_available ()) { + gf_log ("glusterd", GF_LOG_ERROR, "Unable to open" + " /dev/fuse (%s), geo-replication start" + " failed", strerror (errno)); + snprintf (errmsg, sizeof(errmsg), + "fuse unvailable"); + *op_errstr = gf_strdup (errmsg); + ret = -1; + goto out; + } + } break; + case GF_GSYNC_OPTION_TYPE_STOP: ret = glusterd_op_verify_gsync_running (volinfo, slave, op_errstr); -- cgit