summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 68208312acb..5f04cba15db 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -8618,7 +8618,6 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_get_str (rsp_dict, key, &node_uuid);
if (!ret) {
node_uuid_str = gf_strdup (node_uuid);
-
memset (key, 0, 256);
snprintf (key, 256, "node-uuid-%d", src_count+dst_count);
ret = dict_set_dynstr (aggr, key, node_uuid_str);
@@ -8713,7 +8712,8 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_get_str (rsp_dict, "bitrot_log_file", &bitd_log);
if (!ret) {
- ret = dict_set_str (aggr, "bitrot_log_file", bitd_log);
+ ret = dict_set_dynstr_with_alloc (aggr, "bitrot_log_file",
+ bitd_log);
if (ret) {
gf_msg_debug (this->name, 0, "Failed to set "
"bitrot log file location");
@@ -8723,7 +8723,8 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_get_str (rsp_dict, "scrub_log_file", &scrub_log);
if (!ret) {
- ret = dict_set_str (aggr, "scrub_log_file", scrub_log);
+ ret = dict_set_dynstr_with_alloc (aggr, "scrub_log_file",
+ scrub_log);
if (ret) {
gf_msg_debug (this->name, 0, "Failed to set "
"scrubber log file location");
@@ -8733,7 +8734,8 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_get_str (rsp_dict, "features.scrub-freq", &scrub_freq);
if (!ret) {
- ret = dict_set_str (aggr, "features.scrub-freq", scrub_freq);
+ ret = dict_set_dynstr_with_alloc (aggr, "features.scrub-freq",
+ scrub_freq);
if (ret) {
gf_msg_debug (this->name, 0, "Failed to set "
"scrub-frequency value to dictionary");
@@ -8743,8 +8745,9 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_get_str (rsp_dict, "features.scrub-throttle", &scrub_impact);
if (!ret) {
- ret = dict_set_str (aggr, "features.scrub-throttle",
- scrub_impact);
+ ret = dict_set_dynstr_with_alloc (aggr,
+ "features.scrub-throttle",
+ scrub_impact);
if (ret) {
gf_msg_debug (this->name, 0, "Failed to set "
"scrub-throttle value to dictionary");
@@ -8754,7 +8757,8 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_get_str (rsp_dict, "features.scrub", &scrub_state);
if (!ret) {
- ret = dict_set_str (aggr, "features.scrub", scrub_state);
+ ret = dict_set_dynstr_with_alloc (aggr, "features.scrub",
+ scrub_state);
if (ret) {
gf_msg_debug (this->name, 0, "Failed to set "
"scrub state value to dictionary");