diff options
Diffstat (limited to 'cli/src')
| -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 ef07e88b795..c72f99db194 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -5180,23 +5180,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 " @@ -5263,7 +5246,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 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", "=========================================="                   "===============");  | 
