summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorGaurav Kumar Garg <garg.gaurav52@gmail.com>2015-11-23 17:00:07 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-11-23 22:25:47 -0800
commit4348a6af89085cbdb41963f828b88deee4a109f1 (patch)
tree0c50f31509a765df4b18d46c21c139c2ac30736f /cli/src/cli-rpc-ops.c
parentc93e436527e9d2ceed46b939e18edc40b7018cee (diff)
glusterd/bitrot : Integration of bad files from bitd with scrub status command
Currently scrub status command is not displaying list of all the bad files. All the bad files are avaliable in the bitd daemon. With this patch it will dispaly list of all the bad file's in the scrub status command. Change-Id: If09babafaf5d7cf158fa79119abbf5b986027748 BUG: 1207627 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/12720 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 27d0595bd3c..0365539fda5 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -10669,6 +10669,7 @@ int
gf_cli_print_bitrot_scrub_status (dict_t *dict)
{
int i = 1;
+ int j = 0;
int ret = -1;
int count = 0;
char key[256] = {0,};
@@ -10677,6 +10678,7 @@ gf_cli_print_bitrot_scrub_status (dict_t *dict)
char *scrub_freq = NULL;
char *state_scrub = NULL;
char *scrub_impact = NULL;
+ char *bad_file_str = NULL;
char *scrub_log_file = NULL;
char *bitrot_log_file = NULL;
uint64_t scrub_files = 0;
@@ -10802,6 +10804,17 @@ gf_cli_print_bitrot_scrub_status (dict_t *dict)
cli_out ("%s: %"PRIu64 "\n", "Error count", error_count);
+ if (error_count)
+ cli_out ("%s:\n", "Corrupted object's");
+ /* Printing list of bad file's (Corrupted object's)*/
+ for (j = 0; j < error_count; j++) {
+ memset (key, 0, 256);
+ snprintf (key, 256, "quarantine-%d-%d", j, i);
+ ret = dict_get_str (dict, key, &bad_file_str);
+ if (!ret) {
+ cli_out ("%s\n", bad_file_str);
+ }
+ }
}
cli_out ("%s\n", "=========================================="
"===============");