summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2016-04-20 23:49:39 +0530
committerVenky Shankar <vshankar@redhat.com>2016-05-19 23:21:02 -0700
commit911e85a54d0355df3d28be63cc4793d904da17fa (patch)
treef89eda7f5d796f9b1e22617712e51b8f896309a9
parente63049cba0f2b94b0b082cc8bfd5921b8443ef45 (diff)
glusterd/bitrot: Fix bit-rot scrub status
Few of the dictionary values were not allocated and set. This patch allocates them and set. Backport of: >Change-Id: Ic61c1209b238e45219793fd8bec92235adfbd013 >BUG: 1329211 >Signed-off-by: Kotresh HR <khiremat@redhat.com> >Reviewed-on: http://review.gluster.org/14120 >Smoke: Gluster Build System <jenkins@build.gluster.com> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.com> >Reviewed-by: Venky Shankar <vshankar@redhat.com> >Reviewed-by: Atin Mukherjee <amukherj@redhat.com> >Signed-off-by: Kotresh HR <khiremat@redhat.com> BUG: 1332839 Change-Id: If54f0180aaef8ea9ea1544da925ae065becfe53e Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/14202 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
-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 313ae89f3e6..113750710f8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -8670,7 +8670,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);
@@ -8765,7 +8764,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");
@@ -8775,7 +8775,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");
@@ -8785,7 +8786,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");
@@ -8795,8 +8797,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");
@@ -8806,7 +8809,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");