diff options
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index b52a1d287ef..40fd4bb83f2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -7741,7 +7741,13 @@ glusterd_check_and_set_brick_xattr (char *host, char *path, uuid_t uuid, goto out; } else { - sys_lremovexattr (path, "trusted.glusterfs.test"); + ret = sys_lremovexattr (path, "trusted.glusterfs.test"); + if (ret) { + snprintf (msg, sizeof (msg), "Removing test extended" + " attribute failed, reason: %s", + strerror(errno)); + goto out; + } } ret = glusterd_is_path_in_use (path, &in_use, op_errstr); @@ -11236,9 +11242,13 @@ glusterd_volume_tier_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict) if (ret) { gf_msg_debug (this->name, errno, "Missing remove-brick-id"); - } else + } else { ret = dict_set_str (ctx_dict, GF_REMOVE_BRICK_TID_KEY, task_id_str); + if (ret) + gf_msg_debug (this->name, errno, + "Failed to set remove brick task ID"); + } ret = 0; @@ -13173,7 +13183,7 @@ glusterd_get_global_options_for_all_vols (rpcsvc_request_t *req, dict_t *ctx, ALL_VOLUME_OPTION_CHECK ("all", _gf_true, key, ret, op_errstr, out); for (i = 0; valid_all_vol_opts[i].option; i++) { - allvolopt = gf_strdup (valid_all_vol_opts[i].option); + allvolopt = valid_all_vol_opts[i].option; if (!all_opts && strcmp (key, allvolopt) != 0) continue; @@ -13226,6 +13236,7 @@ glusterd_get_global_options_for_all_vols (rpcsvc_request_t *req, dict_t *ctx, if (need_free) { GF_FREE (def_val); + need_free = _gf_false; } def_val = NULL; allvolopt = NULL; @@ -13248,6 +13259,11 @@ out: if (*op_errstr == NULL) *op_errstr = gf_strdup (err_str); } + + if (ret && need_free) { + GF_FREE (def_val); + } + gf_msg_debug (THIS->name, 0, "Returning %d", ret); return ret; |