diff options
| -rw-r--r-- | cli/src/cli-cmd-parser.c | 14 | ||||
| -rw-r--r-- | tests/bugs/bug-1087203.t | 2 | 
2 files changed, 3 insertions, 13 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 5e619f3cd17..7c6e3176dc6 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -3553,7 +3553,7 @@ cli_snap_config_limit_parse (const char **words, dict_t *dict,                               char *key)  {          int             ret             = -1; -        unsigned int    limit           = 0; +        int             limit           = 0;          char            *end_ptr        = NULL;          GF_ASSERT (words); @@ -3576,18 +3576,6 @@ cli_snap_config_limit_parse (const char **words, dict_t *dict,                  goto out;          } -        if (strcmp (key, "snap-max-hard-limit") == 0 && limit > 256) { -                ret = -1; -                cli_err ("%s value cannot be more than 256", key); -                goto out; -        } - -        if (strcmp (key, "snap-max-soft-limit") == 0 && limit > 100) { -                ret = -1; -                cli_err ("%s value cannot be more than 100", key); -                goto out; -        } -          ret = dict_set_int32 (dict, key, limit);          if (ret) {                  gf_log ("cli", GF_LOG_ERROR, "Could not set " diff --git a/tests/bugs/bug-1087203.t b/tests/bugs/bug-1087203.t index 0c4ee01cba5..acbb826013d 100644 --- a/tests/bugs/bug-1087203.t +++ b/tests/bugs/bug-1087203.t @@ -32,6 +32,8 @@ TEST ! $CLI snapshot config snap-max-soft-limit 0111  TEST ! $CLI snapshot config snap-max-hard-limit OXA  TEST ! $CLI snapshot config snap-max-hard-limit 11.11  TEST ! $CLI snapshot config snap-max-soft-limit 50% +TEST ! $CLI snapshot config snap-max-hard-limit -100 +TEST ! $CLI snapshot config snap-max-soft-limit -90  # Soft limit cannot be assigned to volume  TEST ! $CLI snapshot config $V0 snap-max-soft-limit 10  | 
