diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2013-03-20 08:36:14 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-03-21 00:05:19 -0700 |
commit | 66d5d91465deba55afa9e1ab3a2160fc9d1b9275 (patch) | |
tree | 865e380dc9a47ea68b5cfabcadcbaee6e017f33c | |
parent | 1d575d1706bf9968b84d10031bf4b2cfc571db91 (diff) |
performance/io-threads: Fix range-check for least-rate-limit
The issue could be fixed with .validate=GF_OPT_VALIDATE_MIN. But
adding max value is more robust.
Change-Id: Ia69c6f86855dbd34a26e20391e77bfa0f796a200
BUG: 923573
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4698
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rwxr-xr-x | tests/bugs/bug-853680.t | 15 | ||||
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/bugs/bug-853680.t b/tests/bugs/bug-853680.t index a4853c07f8b..72d53ae6c8f 100755 --- a/tests/bugs/bug-853680.t +++ b/tests/bugs/bug-853680.t @@ -15,6 +15,21 @@ TEST glusterd TEST $CLI volume create $V0 $H0:$B0/${V0}1 TEST $CLI volume start $V0 +#Accept min val +TEST $CLI volume set $V0 performance.least-rate-limit 0 +#Accept some value in between +TEST $CLI volume set $V0 performance.least-rate-limit 1035 +#Accept max val INT_MAX +TEST $CLI volume set $V0 performance.least-rate-limit 2147483647 + +#Reject other values +TEST ! $CLI volume set $V0 performance.least-rate-limit 2147483648 +TEST ! $CLI volume set $V0 performace.least-rate-limit -8 +TEST ! $CLI volume set $V0 performance.least-rate-limit abc +TEST ! $CLI volume set $V0 performance.least-rate-limit 0.0 +TEST ! $CLI volume set $V0 performance.least-rate-limit -10.0 +TEST ! $CLI volume set $V0 performance.least-rate-limit 1% + # set rate limit to 1 operation/sec TEST $CLI volume set $V0 performance.least-rate-limit 1 diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index ccbd4119483..226c091f16a 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -2799,6 +2799,7 @@ struct volume_options options[] = { {.key = {"least-rate-limit"}, .type = GF_OPTION_TYPE_INT, .min = 0, + .max = INT_MAX, .default_value = "0", .description = "Max number of least priority operations to handle " "per-second" |