diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 23 | ||||
-rw-r--r-- | cli/src/cli-rpc-ops.c | 13 |
2 files changed, 18 insertions, 18 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 94c9fddfe1f..1d4d6cf89c7 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -5185,23 +5185,6 @@ cli_cmd_bitrot_parse (const char **words, int wordcount, dict_t **options) } } - if ((strcmp (words[3], "scrub") == 0) && - (strcmp (words[4], "status") == 0)) { - if (wordcount == 5) { - type = GF_BITROT_CMD_SCRUB_STATUS; - ret = dict_set_str (dict, "scrub-value", - (char *) words[4]); - if (ret) { - cli_out ("Failed to set dict for scrub status"); - goto out; - } - goto set_type; - } else { - ret = -1; - goto out; - } - } - if (!strcmp (w, "scrub-throttle")) { if (!words[4]) { cli_err ("Missing scrub-throttle value for bitrot " @@ -5268,7 +5251,11 @@ cli_cmd_bitrot_parse (const char **words, int wordcount, dict_t **options) ret = -1; goto out; } else { - type = GF_BITROT_OPTION_TYPE_SCRUB; + if (strcmp (words[4], "status") == 0) { + type = GF_BITROT_CMD_SCRUB_STATUS; + } else { + type = GF_BITROT_OPTION_TYPE_SCRUB; + } ret = dict_set_str (dict, "scrub-value", (char *) words[4]); if (ret) { diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 24ca507c904..20c8c1d30d4 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -10675,6 +10675,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,}; @@ -10683,6 +10684,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; @@ -10808,6 +10810,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", "==========================================" "==============="); |