From e07337d56ea91e75c48ccdc8c386ce892969ca62 Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Thu, 4 May 2017 15:49:59 +0530 Subject: Tier: Watermark check for hi and low value being equal back-port of : https://review.gluster.org/17175 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 >Reviewed-on: https://review.gluster.org/17175 >Smoke: Gluster Build System >Tested-by: hari gowtham >Reviewed-by: Atin Mukherjee >Reviewed-by: Milind Changire >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System Change-Id: Ia235163aeefdcb2a059e2e58a5cfd8fb7f1a4c64 BUG: 1448790 Signed-off-by: hari gowtham Reviewed-on: https://review.gluster.org/17202 Smoke: Gluster Build System Tested-by: hari gowtham NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-volume-set.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 43f3999f88c..bb3e2100901 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); -- cgit