diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 216 |
1 files changed, 142 insertions, 74 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 49baa5814d9..bf062c87060 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -76,6 +76,19 @@ static char *gsync_reserved_opts[] = {"gluster-command", static char *gsync_no_restart_opts[] = {"checkpoint", "log_rsync_performance", "log-rsync-performance", NULL}; +void +set_gsyncd_inet6_arg(runner_t *runner) +{ + xlator_t *this = NULL; + char *af; + int ret; + + this = THIS; + ret = dict_get_str(this->options, "transport.address-family", &af); + if (ret == 0) + runner_argprintf(runner, "--%s", af); +} + int __glusterd_handle_sys_exec(rpcsvc_request_t *req) { @@ -102,13 +115,18 @@ __glusterd_handle_sys_exec(rpcsvc_request_t *req) ret = xdr_to_generic(req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req); if (ret < 0) { req->rpc_err = GARBAGE_ARGS; + snprintf(err_str, sizeof(err_str), "Garbage args received"); + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_GARBAGE_ARGS, NULL); goto out; } if (cli_req.dict.dict_len) { dict = dict_new(); - if (!dict) + if (!dict) { + gf_smsg(THIS->name, GF_LOG_ERROR, errno, GD_MSG_DICT_CREATE_FAIL, + NULL); goto out; + } ret = dict_unserialize(cli_req.dict.dict_val, cli_req.dict.dict_len, &dict); @@ -129,13 +147,18 @@ __glusterd_handle_sys_exec(rpcsvc_request_t *req) snprintf(err_str, sizeof(err_str), "Failed to get " "the uuid of local glusterd"); + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_UUID_GET_FAIL, + NULL); ret = -1; goto out; } ret = dict_set_dynstr(dict, "host-uuid", host_uuid); - if (ret) + if (ret) { + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED, + "Key=host-uuid", NULL); goto out; + } } ret = glusterd_op_begin_synctask(req, cli_op, dict); @@ -175,13 +198,18 @@ __glusterd_handle_copy_file(rpcsvc_request_t *req) ret = xdr_to_generic(req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req); if (ret < 0) { req->rpc_err = GARBAGE_ARGS; + snprintf(err_str, sizeof(err_str), "Garbage args received"); + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_GARBAGE_ARGS, NULL); goto out; } if (cli_req.dict.dict_len) { dict = dict_new(); - if (!dict) + if (!dict) { + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_CREATE_FAIL, + NULL); goto out; + } ret = dict_unserialize(cli_req.dict.dict_val, cli_req.dict.dict_len, &dict); @@ -202,6 +230,8 @@ __glusterd_handle_copy_file(rpcsvc_request_t *req) snprintf(err_str, sizeof(err_str), "Failed to get " "the uuid of local glusterd"); + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_UUID_GET_FAIL, + NULL); ret = -1; goto out; } @@ -254,13 +284,18 @@ __glusterd_handle_gsync_set(rpcsvc_request_t *req) ret = xdr_to_generic(req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req); if (ret < 0) { req->rpc_err = GARBAGE_ARGS; + snprintf(err_str, sizeof(err_str), "Garbage args received"); + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_GARBAGE_ARGS, NULL); goto out; } if (cli_req.dict.dict_len) { dict = dict_new(); - if (!dict) + if (!dict) { + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_CREATE_FAIL, + NULL); goto out; + } ret = dict_unserialize(cli_req.dict.dict_val, cli_req.dict.dict_len, &dict); @@ -281,6 +316,8 @@ __glusterd_handle_gsync_set(rpcsvc_request_t *req) snprintf(err_str, sizeof(err_str), "Failed to get " "the uuid of local glusterd"); + gf_smsg(this->name, GF_LOG_ERROR, errno, GD_MSG_UUID_GET_FAIL, + NULL); ret = -1; goto out; } @@ -384,6 +421,7 @@ glusterd_urltransform_init(runner_t *runner, const char *transname) { runinit(runner); runner_add_arg(runner, GSYNCD_PREFIX "/gsyncd"); + set_gsyncd_inet6_arg(runner); runner_argprintf(runner, "--%s-url", transname); } @@ -725,6 +763,7 @@ glusterd_get_slave_voluuid(char *slave_host, char *slave_vol, char *vol_uuid) runinit(&runner); runner_add_arg(&runner, GSYNCD_PREFIX "/gsyncd"); + set_gsyncd_inet6_arg(&runner); runner_add_arg(&runner, "--slavevoluuid-get"); runner_argprintf(&runner, "%s::%s", slave_host, slave_vol); @@ -788,6 +827,7 @@ glusterd_gsync_get_config(char *master, char *slave, char *conf_path, runinit(&runner); runner_add_args(&runner, GSYNCD_PREFIX "/gsyncd", "-c", NULL); runner_argprintf(&runner, "%s", conf_path); + set_gsyncd_inet6_arg(&runner); runner_argprintf(&runner, "--iprefix=%s", DATADIR); runner_argprintf(&runner, ":%s", master); runner_add_args(&runner, slave, "--config-get-all", NULL); @@ -917,6 +957,7 @@ glusterd_gsync_get_status(char *master, char *slave, char *conf_path, runinit(&runner); runner_add_args(&runner, GSYNCD_PREFIX "/gsyncd", "-c", NULL); runner_argprintf(&runner, "%s", conf_path); + set_gsyncd_inet6_arg(&runner); runner_argprintf(&runner, "--iprefix=%s", DATADIR); runner_argprintf(&runner, ":%s", master); runner_add_args(&runner, slave, "--status-get", NULL); @@ -937,6 +978,7 @@ glusterd_gsync_get_param_file(char *prmfile, const char *param, char *master, runinit(&runner); runner_add_args(&runner, GSYNCD_PREFIX "/gsyncd", "-c", NULL); runner_argprintf(&runner, "%s", conf_path); + set_gsyncd_inet6_arg(&runner); runner_argprintf(&runner, "--iprefix=%s", DATADIR); runner_argprintf(&runner, ":%s", master); runner_add_args(&runner, slave, "--config-get", NULL); @@ -1712,9 +1754,10 @@ glusterd_store_slave_in_info(glusterd_volinfo_t *volinfo, char *slave, char *value = NULL; char *slavekey = NULL; char *slaveentry = NULL; - char key[512] = { + char key[32] = { 0, }; + int keylen; char *t = NULL; xlator_t *this = NULL; struct slave_vol_config slave1 = { @@ -1792,15 +1835,15 @@ glusterd_store_slave_in_info(glusterd_volinfo_t *volinfo, char *slave, if (ret == 0) { /* New slave */ dict_foreach(volinfo->gsync_slaves, _get_max_gsync_slave_num, &maxslv); - snprintf(key, sizeof(key), "slave%d", maxslv + 1); + keylen = snprintf(key, sizeof(key), "slave%d", maxslv + 1); - ret = dict_set_dynstr(volinfo->gsync_slaves, key, value); + ret = dict_set_dynstrn(volinfo->gsync_slaves, key, keylen, value); if (ret) { GF_FREE(value); goto out; } } else if (ret == -1) { /* Existing slave */ - snprintf(key, sizeof(key), "slave%d", slave1.old_slvidx); + keylen = snprintf(key, sizeof(key), "slave%d", slave1.old_slvidx); gf_msg_debug(this->name, 0, "Replacing key:%s with new value" @@ -1808,7 +1851,7 @@ glusterd_store_slave_in_info(glusterd_volinfo_t *volinfo, char *slave, key, value); /* Add new slave's value, with the same slave index */ - ret = dict_set_dynstr(volinfo->gsync_slaves, key, value); + ret = dict_set_dynstrn(volinfo->gsync_slaves, key, keylen, value); if (ret) { GF_FREE(value); goto out; @@ -2232,6 +2275,9 @@ glusterd_op_verify_gsync_running(glusterd_volinfo_t *volinfo, char *slave, "Volume %s needs to be started " "before " GEOREP " start", volinfo->volname); + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_GEO_REP_START_FAILED, + "Volume is not in a started state, Volname=%s", + volinfo->volname, NULL); goto out; } @@ -2288,7 +2334,6 @@ glusterd_verify_gsync_status_opts(dict_t *dict, char **op_errstr) char errmsg[PATH_MAX] = { 0, }; - gf_boolean_t exists = _gf_false; glusterd_volinfo_t *volinfo = NULL; int ret = 0; char *conf_path = NULL; @@ -2316,9 +2361,8 @@ glusterd_verify_gsync_status_opts(dict_t *dict, char **op_errstr) goto out; } - exists = glusterd_check_volume_exists(volname); ret = glusterd_volinfo_find(volname, &volinfo); - if ((ret) || (!exists)) { + if (ret) { gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_VOL_NOT_FOUND, "volume name does not exist"); snprintf(errmsg, sizeof(errmsg), @@ -2326,7 +2370,6 @@ glusterd_verify_gsync_status_opts(dict_t *dict, char **op_errstr) " exist", volname); *op_errstr = gf_strdup(errmsg); - ret = -1; goto out; } @@ -2539,6 +2582,7 @@ glusterd_op_stage_copy_file(dict_t *dict, char **op_errstr) len = snprintf(abs_filename, sizeof(abs_filename), "%s/%s", priv->workdir, filename); if ((len < 0) || (len >= sizeof(abs_filename))) { + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_COPY_FAIL, NULL); ret = -1; goto out; } @@ -2551,6 +2595,9 @@ glusterd_op_stage_copy_file(dict_t *dict, char **op_errstr) if (len < 0) { strcpy(errmsg, "<error>"); } + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_REALPATH_GET_FAIL, + "Realpath=%s, Reason=%s", priv->workdir, strerror(errno), + NULL); *op_errstr = gf_strdup(errmsg); ret = -1; goto out; @@ -2561,6 +2608,8 @@ glusterd_op_stage_copy_file(dict_t *dict, char **op_errstr) "Failed to get " "realpath of %s: %s", filename, strerror(errno)); + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_REALPATH_GET_FAIL, + "Filename=%s, Reason=%s", filename, strerror(errno), NULL); *op_errstr = gf_strdup(errmsg); ret = -1; goto out; @@ -2570,6 +2619,7 @@ glusterd_op_stage_copy_file(dict_t *dict, char **op_errstr) will succeed for /var/lib/glusterd_bad */ len = snprintf(workdir, sizeof(workdir), "%s/", realpath_workdir); if ((len < 0) || (len >= sizeof(workdir))) { + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_COPY_FAIL, NULL); ret = -1; goto out; } @@ -2583,6 +2633,8 @@ glusterd_op_stage_copy_file(dict_t *dict, char **op_errstr) if (len < 0) { strcpy(errmsg, "<error>"); } + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_SRC_FILE_ERROR, errmsg, + NULL); *op_errstr = gf_strdup(errmsg); ret = -1; goto out; @@ -2597,6 +2649,8 @@ glusterd_op_stage_copy_file(dict_t *dict, char **op_errstr) if (len < 0) { strcpy(errmsg, "<error>"); } + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_SRC_FILE_ERROR, errmsg, + NULL); *op_errstr = gf_strdup(errmsg); goto out; } @@ -2605,9 +2659,9 @@ glusterd_op_stage_copy_file(dict_t *dict, char **op_errstr) snprintf(errmsg, sizeof(errmsg), "Source file" " is not a regular file."); + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_SRC_FILE_ERROR, errmsg, + NULL); *op_errstr = gf_strdup(errmsg); - gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SRC_FILE_ERROR, "%s", - errmsg); ret = -1; goto out; } @@ -2811,6 +2865,7 @@ glusterd_verify_slave(char *volname, char *slave_url, char *slave_vol, char *slave_ip = NULL; glusterd_conf_t *priv = NULL; xlator_t *this = NULL; + char *af = NULL; this = THIS; GF_ASSERT(this); @@ -2825,8 +2880,11 @@ glusterd_verify_slave(char *volname, char *slave_url, char *slave_vol, */ if (strstr(slave_url, "@")) { slave_url_buf = gf_strdup(slave_url); - if (!slave_url_buf) + if (!slave_url_buf) { + gf_smsg(this->name, GF_LOG_ERROR, 0, GD_MSG_STRDUP_FAILED, + "Slave_url=%s", slave_url, NULL); goto out; + } slave_user = strtok_r(slave_url_buf, "@", &save_ptr); slave_ip = strtok_r(NULL, "@", &save_ptr); @@ -2841,8 +2899,8 @@ glusterd_verify_slave(char *volname, char *slave_url, char *slave_vol, goto out; } - snprintf(log_file_path, sizeof(log_file_path), - DEFAULT_LOG_FILE_DIRECTORY "/create_verify_log"); + snprintf(log_file_path, sizeof(log_file_path), "%s/create_verify_log", + priv->logdir); runinit(&runner); runner_add_args(&runner, GSYNCD_PREFIX "/gverify.sh", NULL); @@ -2852,9 +2910,16 @@ glusterd_verify_slave(char *volname, char *slave_url, char *slave_vol, runner_argprintf(&runner, "%s", slave_vol); runner_argprintf(&runner, "%d", ssh_port); runner_argprintf(&runner, "%s", log_file_path); - gf_msg_debug(this->name, 0, "gverify Args = %s %s %s %s %s %s %s", + ret = dict_get_str(this->options, "transport.address-family", &af); + if (ret) + af = "-"; + + runner_argprintf(&runner, "%s", af); + + gf_msg_debug(this->name, 0, "gverify Args = %s %s %s %s %s %s %s %s", runner.argv[0], runner.argv[1], runner.argv[2], runner.argv[3], - runner.argv[4], runner.argv[5], runner.argv[6]); + runner.argv[4], runner.argv[5], runner.argv[6], + runner.argv[7]); runner_redir(&runner, STDOUT_FILENO, RUN_PIPE); synclock_unlock(&priv->big_lock); ret = runner_run(&runner); @@ -3114,7 +3179,6 @@ glusterd_op_stage_gsync_create(dict_t *dict, char **op_errstr) gf_boolean_t is_force = -1; gf_boolean_t is_no_verify = -1; gf_boolean_t is_force_blocker = -1; - gf_boolean_t exists = _gf_false; gf_boolean_t is_template_in_use = _gf_false; glusterd_conf_t *conf = NULL; glusterd_volinfo_t *volinfo = NULL; @@ -3164,18 +3228,15 @@ glusterd_op_stage_gsync_create(dict_t *dict, char **op_errstr) goto out; } - exists = glusterd_check_volume_exists(volname); ret = glusterd_volinfo_find(volname, &volinfo); - if ((ret) || (!exists)) { + if (ret) { gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_VOL_NOT_FOUND, "volume name does not exist"); snprintf(errmsg, sizeof(errmsg), "Volume name %s does not" " exist", volname); - *op_errstr = gf_strdup(errmsg); - gf_msg_debug(this->name, 0, "Returning %d", ret); - return -1; + goto out; } ret = glusterd_get_slave_details_confpath(volinfo, dict, &slave_url, @@ -3416,6 +3477,12 @@ glusterd_op_stage_gsync_create(dict_t *dict, char **op_errstr) goto out; } + /* There is a remote possibility that slave_host can be NULL when + control reaches here. Add a check so we wouldn't crash in next + line */ + if (!slave_host) + goto out; + /* Now, check whether session is already started.If so, warn!*/ is_different_slavehost = (strcmp(slave_host, slave1.old_slvhost) != 0) ? _gf_true @@ -3510,7 +3577,6 @@ out: if (slave_url_buf) GF_FREE(slave_url_buf); - gf_msg_debug(this->name, 0, "Returning %d", ret); return ret; } @@ -3589,7 +3655,6 @@ glusterd_op_stage_gsync_set(dict_t *dict, char **op_errstr) char *statedir = NULL; char *path_list = NULL; char *conf_path = NULL; - gf_boolean_t exists = _gf_false; glusterd_volinfo_t *volinfo = NULL; char errmsg[PATH_MAX] = { 0, @@ -3640,14 +3705,12 @@ glusterd_op_stage_gsync_set(dict_t *dict, char **op_errstr) goto out; } - exists = glusterd_check_volume_exists(volname); ret = glusterd_volinfo_find(volname, &volinfo); - if ((ret) || (!exists)) { + if (ret) { snprintf(errmsg, sizeof(errmsg), "Volume name %s does not" " exist", volname); - ret = -1; goto out; } @@ -4081,6 +4144,7 @@ gd_pause_or_resume_gsync(dict_t *dict, char *master, char *slave, out: sys_close(pfd); + /* coverity[INTEGER_OVERFLOW] */ return ret; } @@ -4145,10 +4209,10 @@ stop_gsync(char *master, char *slave, char **msg, char *conf_path, * still be alive, give some more time * before SIGKILL (hack) */ - usleep(50000); + gf_nanosleep(50000 * GF_US_IN_NS); break; } - usleep(50000); + gf_nanosleep(50000 * GF_US_IN_NS); } kill(-pid, SIGKILL); sys_unlink(pidfile); @@ -4157,7 +4221,7 @@ stop_gsync(char *master, char *slave, char **msg, char *conf_path, out: sys_close(pfd); - + /* coverity[INTEGER_OVERFLOW] */ return ret; } @@ -5092,7 +5156,6 @@ glusterd_get_gsync_status(dict_t *dict, char **op_errstr, dict_t *rsp_dict) char errmsg[PATH_MAX] = { 0, }; - gf_boolean_t exists = _gf_false; glusterd_volinfo_t *volinfo = NULL; int ret = 0; char my_hostname[256] = { @@ -5115,9 +5178,8 @@ glusterd_get_gsync_status(dict_t *dict, char **op_errstr, dict_t *rsp_dict) goto out; } - exists = glusterd_check_volume_exists(volname); ret = glusterd_volinfo_find(volname, &volinfo); - if ((ret) || (!exists)) { + if (ret) { gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_VOL_NOT_FOUND, "volume name does not exist"); snprintf(errmsg, sizeof(errmsg), @@ -5125,7 +5187,6 @@ glusterd_get_gsync_status(dict_t *dict, char **op_errstr, dict_t *rsp_dict) " exist", volname); *op_errstr = gf_strdup(errmsg); - ret = -1; goto out; } @@ -5955,7 +6016,7 @@ glusterd_get_slave_info(char *slave, char **slave_url, char **hostname, GF_ASSERT(this); ret = glusterd_urltransform_single(slave, "normalize", &linearr); - if (ret == -1) { + if ((ret == -1) || (linearr[0] == NULL)) { ret = snprintf(errmsg, sizeof(errmsg) - 1, "Invalid Url: %s", slave); errmsg[ret] = '\0'; *op_errstr = gf_strdup(errmsg); @@ -5966,7 +6027,10 @@ glusterd_get_slave_info(char *slave, char **slave_url, char **hostname, tmp = strtok_r(linearr[0], "/", &save_ptr); tmp = strtok_r(NULL, "/", &save_ptr); - slave = strtok_r(tmp, ":", &save_ptr); + slave = NULL; + if (tmp != NULL) { + slave = strtok_r(tmp, ":", &save_ptr); + } if (slave) { ret = glusterd_geo_rep_parse_slave(slave, hostname, op_errstr); if (ret) { @@ -6220,26 +6284,28 @@ create_conf_file(glusterd_conf_t *conf, char *conf_path) /* log-file */ runinit_gsyncd_setrx(&runner, conf_path); - runner_add_args(&runner, "log-file", - DEFAULT_LOG_FILE_DIRECTORY "/" GEOREP - "/${mastervol}/${eSlave}.log", - ".", ".", NULL); + runner_add_arg(&runner, "log-file"); + runner_argprintf(&runner, "%s/%s/${mastervol}/${eSlave}.log", conf->logdir, + GEOREP); + runner_add_args(&runner, ".", ".", NULL); RUN_GSYNCD_CMD; /* changelog-log-file */ runinit_gsyncd_setrx(&runner, conf_path); - runner_add_args(&runner, "changelog-log-file", - DEFAULT_LOG_FILE_DIRECTORY - "/" GEOREP "/${mastervol}/${eSlave}${local_id}-changes.log", - ".", ".", NULL); + runner_add_arg(&runner, "changelog-log-file"); + runner_argprintf(&runner, + "%s/%s/${mastervol}/${eSlave}${local_id}-changes.log", + conf->logdir, GEOREP); + runner_add_args(&runner, ".", ".", NULL); RUN_GSYNCD_CMD; /* gluster-log-file */ runinit_gsyncd_setrx(&runner, conf_path); - runner_add_args(&runner, "gluster-log-file", - DEFAULT_LOG_FILE_DIRECTORY - "/" GEOREP "/${mastervol}/${eSlave}${local_id}.gluster.log", - ".", ".", NULL); + runner_add_arg(&runner, "gluster-log-file"); + runner_argprintf(&runner, + "%s/%s/${mastervol}/${eSlave}${local_id}.gluster.log", + conf->logdir, GEOREP); + runner_add_args(&runner, ".", ".", NULL); RUN_GSYNCD_CMD; /* ignore-deletes */ @@ -6281,33 +6347,35 @@ create_conf_file(glusterd_conf_t *conf, char *conf_path) /* log-file */ runinit_gsyncd_setrx(&runner, conf_path); - runner_add_args( - &runner, "log-file", - DEFAULT_LOG_FILE_DIRECTORY - "/" GEOREP - "-slaves/${session_owner}:${local_node}${local_id}.${slavevol}.log", - ".", NULL); + runner_add_arg(&runner, "log-file"); + runner_argprintf(&runner, + "%s/%s-slaves/" + "${session_owner}:${local_node}${local_id}.${slavevol}." + "log", + conf->logdir, GEOREP); + runner_add_args(&runner, ".", ".", NULL); RUN_GSYNCD_CMD; /* MountBroker log-file */ runinit_gsyncd_setrx(&runner, conf_path); - runner_add_args( - &runner, "log-file-mbr", - DEFAULT_LOG_FILE_DIRECTORY - "/" GEOREP - "-slaves/mbr/${session_owner}:${local_node}${local_id}.${slavevol}.log", - ".", NULL); + runner_add_arg(&runner, "log-file-mbr"); + runner_argprintf(&runner, + "%s/%s-slaves/mbr/" + "${session_owner}:${local_node}${local_id}.${slavevol}." + "log", + conf->logdir, GEOREP); + runner_add_args(&runner, ".", ".", NULL); RUN_GSYNCD_CMD; /* gluster-log-file */ runinit_gsyncd_setrx(&runner, conf_path); - runner_add_args( - &runner, "gluster-log-file", - DEFAULT_LOG_FILE_DIRECTORY - "/" GEOREP - "-slaves/" - "${session_owner}:${local_node}${local_id}.${slavevol}.gluster.log", - ".", NULL); + runner_add_arg(&runner, "gluster-log-file"); + runner_argprintf(&runner, + "%s/%s-slaves/" + "${session_owner}:${local_node}${local_id}.${slavevol}." + "gluster.log", + conf->logdir, GEOREP); + runner_add_args(&runner, ".", ".", NULL); RUN_GSYNCD_CMD; out: @@ -6358,7 +6426,7 @@ glusterd_create_essential_dir_files(glusterd_volinfo_t *volinfo, dict_t *dict, ret = -1; goto out; } - ret = mkdir_p(buf, 0777, _gf_true); + ret = mkdir_p(buf, 0755, _gf_true); if (ret) { len = snprintf(errmsg, sizeof(errmsg), "Unable to create %s" @@ -6373,13 +6441,13 @@ glusterd_create_essential_dir_files(glusterd_volinfo_t *volinfo, dict_t *dict, goto out; } - ret = snprintf(buf, PATH_MAX, DEFAULT_LOG_FILE_DIRECTORY "/" GEOREP "/%s", + ret = snprintf(buf, PATH_MAX, "%s/" GEOREP "/%s", conf->logdir, volinfo->volname); if ((ret < 0) || (ret >= PATH_MAX)) { ret = -1; goto out; } - ret = mkdir_p(buf, 0777, _gf_true); + ret = mkdir_p(buf, 0755, _gf_true); if (ret) { len = snprintf(errmsg, sizeof(errmsg), "Unable to create %s" |
