summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2017-05-04 15:49:59 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-05-08 03:58:18 +0000
commit2502162502009d4be75e67e49d71f3f38aaa7595 (patch)
tree5cdd5d57af751bfcd738aadc14f0f498bd454df0 /xlators/mgmt
parent1538b7296cc0a3150f33190f97dc99c9ca126322 (diff)
Tier: Watermark check for hi and low value being equal
Problem: Both low and hi watermark can be set to same value as the check missed the case for being equal. Fix: Add the check to both the hi and low values being equal along with the low value being higher than hi value. Change-Id: Ia235163aeefdcb2a059e2e58a5cfd8fb7f1a4c64 BUG: 1447960 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: https://review.gluster.org/17175 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: hari gowtham <hari.gowtham005@gmail.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Milind Changire <mchangir@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 1b26f7d8397..a5659248253 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -447,9 +447,10 @@ validate_tier (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
gf_string2bytesize_uint64 (current_wm_low,
&wm_low);
}
- if (wm_low > wm_hi) {
+ if (wm_low >= wm_hi) {
snprintf (errstr, sizeof (errstr), "lower watermark"
- " cannot exceed upper watermark.");
+ " cannot be equal or exceed upper "
+ "watermark.");
gf_msg (this->name, GF_LOG_ERROR, EINVAL,
GD_MSG_INCOMPATIBLE_VALUE, "%s", errstr);
*op_errstr = gf_strdup (errstr);