summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-08-10 18:31:55 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-08-17 04:02:20 +0000
commit3998c28324c8907b9b3ade75c98a6a0e4591f23b (patch)
tree0f8dd704dabdac15c03fcc383f44171c167ae807 /xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
parent204d52a4b6c13d16132f67ee94f823fa23c11538 (diff)
glusterd: introduce max-port range
glusterd.vol file always had an option (commented out) to indicate the base-port to start the portmapper allocation. This patch brings in the max-port configuration where one can limit the range of ports which gluster can be allowed to bind. Fixes: #305 Change-Id: Id7a864f818227b9530a07e13d605138edacd9aa9 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/18016 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Gaurav Yadav <gyadav@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapd-svc.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapd-svc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
index ea56d8012aa..b6e6a814ca2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
@@ -302,6 +302,14 @@ glusterd_snapdsvc_start (glusterd_svc_t *svc, int flags)
NULL);
snapd_port = pmap_assign_port (THIS, volinfo->snapd.port, snapd_id);
+ if (!snapd_port) {
+ gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_PORTS_EXHAUSTED,
+ "All the ports in the range are exhausted, can't start "
+ "snapd for volume %s", volinfo->volname);
+ ret = -1;
+ goto out;
+ }
+
volinfo->snapd.port = snapd_port;
runner_add_arg (&runner, "--brick-port");