summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-12-15 14:39:25 +0530
committerDan Lambright <dlambrig@redhat.com>2015-12-16 06:45:26 -0800
commit4eb7c968a682e59d97efcbc2afa41690dfdd22a2 (patch)
treea262d06b2fed2788724dcc3ef02d5a797b84ee39
parent7ba6469eee3118cc4ece905d2538ef778320ae63 (diff)
tier/glusterd: Only positive values for freq-thresholds
Fixed error handling for validation for freq-thresholds Change-Id: Ibe3a9752ac0b525b0c8c0d6c4b4e4d694bd91b88 BUG: 1291603 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/12970 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
-rwxr-xr-xtests/basic/tier/tier.t4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/basic/tier/tier.t b/tests/basic/tier/tier.t
index a197d6eb127..c7c95690e70 100755
--- a/tests/basic/tier/tier.t
+++ b/tests/basic/tier/tier.t
@@ -110,6 +110,9 @@ TEST $CLI volume set $V0 cluster.tier-max-mb 1000
TEST $CLI volume set $V0 cluster.tier-max-files 1000
TEST ! $CLI volume set $V0 cluster.tier-max-files -3
TEST ! $CLI volume set $V0 cluster.watermark-low 90
+TEST ! $CLI volume set $V0 cluster.read-freq-threshold -12
+TEST ! $CLI volume set $V0 cluster.write-freq-threshold -12
+
# stop the volume and restart it. The rebalance daemon should restart.
cd /tmp
@@ -128,6 +131,7 @@ TEST ! $CLI volume set $V0 cluster.tier-promote-frequency -1
#Tier options expect non-negative value
TEST ! $CLI volume set $V0 cluster.read-freq-threshold qwerty
+
TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ
TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ
TEST $CLI volume set $V0 cluster.read-freq-threshold 0
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index e4765f6f0d9..f849c313e87 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -176,6 +176,7 @@ validate_tier_thresholds (glusterd_volinfo_t *volinfo,
if (ret) {
snprintf (errstr, sizeof (errstr), "%s is not a compatible "
"value. %s expects an integer value.", value, key);
+ ret = -1;
goto out;
}
@@ -183,6 +184,7 @@ validate_tier_thresholds (glusterd_volinfo_t *volinfo,
snprintf (errstr, sizeof (errstr), "%s is not a "
"compatible value. %s expects a positive"
"integer value.", value, key);
+ ret = -1;
goto out;
}