summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtests/bugs/bug-853680.t15
-rw-r--r--xlators/performance/io-threads/src/io-threads.c1
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"