From c5b81783d5532a3b3a2bd1948bd1c9bfa4a023e1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 13 Jun 2017 10:06:57 +0200 Subject: glusterd: fix quorum calculation if percentage is not specified correctly There was an extra "ratio = _gf_true". - In case the ratio was specified correctly in the volfile, this is redundant. - In case the ratio was specified, but not parseable into a precentage, this is wrong and would lead to a quorum count of 0 instead of falling back to the default of 50% + 1. This patch removes the extra setting of "ratio". Change-Id: I2bd57ebf1b8989e905481a2b6285a1f422942f72 BUG: 1461129 Signed-off-by: Michael Adam Reviewed-on: https://review.gluster.org/17538 Reviewed-by: Atin Mukherjee Tested-by: Atin Mukherjee NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System --- xlators/mgmt/glusterd/src/glusterd-server-quorum.c | 1 - 1 file changed, 1 deletion(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-server-quorum.c b/xlators/mgmt/glusterd/src/glusterd-server-quorum.c index 606d33e8c5d..a4637f84368 100644 --- a/xlators/mgmt/glusterd/src/glusterd-server-quorum.c +++ b/xlators/mgmt/glusterd/src/glusterd-server-quorum.c @@ -234,7 +234,6 @@ glusterd_get_quorum_cluster_counts (xlator_t *this, int *active_count, ret = dict_get_str (conf->opts, GLUSTERD_QUORUM_RATIO_KEY, &val); if (ret == 0) { - ratio = _gf_true; ret = gf_string2percent (val, &quorum_percentage); if (!ret) ratio = _gf_true; -- cgit