diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2015-12-03 14:54:32 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2015-12-29 01:09:03 -0800 |
commit | 8a9a532fd141a5456fea9729abf4273bd653cc39 (patch) | |
tree | fdc4ab71482b672f119ccaffda6114002a2856a9 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 101243860bca1bbda8a03ab76f6753ecc10799ed (diff) |
glusterd: Disallow peer with existing volumes to be probed in cluster
Backport of http://review.gluster.org/12864
As of now we do allow peer to get added in the trusted storage pool even if it
has a volume configured. This is definitely not a supported configuration and
can lead to issues as we never claim to support merging clusters. A single node
running a standalone volume can be considered as a cluster.
Change-Id: Id0cf42d6e5f20d6bfdb7ee19d860eee67c7c45be
BUG: 1288963
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/12864
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-on: http://review.gluster.org/12888
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 6fc0dcdc603..98c519751df 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -4543,6 +4543,25 @@ glusterd_all_volumes_with_quota_stopped () return _gf_true; } +gf_boolean_t +glusterd_have_volumes () +{ + xlator_t *this = NULL; + glusterd_conf_t *priv = NULL; + gf_boolean_t volumes_exist = _gf_false; + + this = THIS; + GF_VALIDATE_OR_GOTO ("glusterd", (this != NULL), out); + + priv = this->private; + GF_VALIDATE_OR_GOTO (this->name, (priv != NULL), out); + + + volumes_exist = !cds_list_empty (&priv->volumes); +out: + return volumes_exist; +} + int glusterd_volume_count_get (void) { |