From 1737a475156124ead29fbae140df92e2f6e7a49e Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Sat, 30 Apr 2016 14:02:01 +0530 Subject: glusterd: fix max pmap alloc to GF_PORT_MAX This patch also mops the port max i.e 65535 hard coding Backport of: > Change-Id: Ia93656d75ceb4c6c4849f9e0ad1b260d5952d4c6 > BUG: 1331253 > Signed-off-by: Prasanna Kumar Kalever > Reviewed-on: http://review.gluster.org/14096 > Tested-by: Prasanna Kumar Kalever > Smoke: Gluster Build System > Reviewed-by: Atin Mukherjee > CentOS-regression: Gluster Build System > NetBSD-regression: NetBSD Build System Change-Id: Idf07dd5d08957aed9287e7df2f3fc6f0f32039c1 BUG: 1331772 Signed-off-by: Prasanna Kumar Kalever Reviewed-on: http://review.gluster.org/14127 Tested-by: Prasanna Kumar Kalever Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-pmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c index fbdcfc86050..d74a565def4 100644 --- a/xlators/mgmt/glusterd/src/glusterd-pmap.c +++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c @@ -63,7 +63,7 @@ pmap_registry_new (xlator_t *this) if (!pmap) return NULL; - for (i = 0; i < 65536; i++) { + for (i = 0; i <= GF_PORT_MAX; i++) { if (pmap_port_isfree (i)) pmap->ports[i].type = GF_PMAP_PORT_FREE; else @@ -166,7 +166,7 @@ pmap_registry_search_by_port (xlator_t *this, int port) struct pmap_registry *pmap = NULL; char *brickname = NULL; - if (port > 65535) + if (port > GF_PORT_MAX) goto out; pmap = pmap_registry_get (this); @@ -188,7 +188,7 @@ pmap_registry_alloc (xlator_t *this) pmap = pmap_registry_get (this); - for (p = pmap->last_alloc; p < 65535; p++) { + for (p = pmap->last_alloc; p <= GF_PORT_MAX; p++) { if (pmap->ports[p].type != GF_PMAP_PORT_FREE) continue; @@ -214,7 +214,7 @@ pmap_registry_bind (xlator_t *this, int port, const char *brickname, pmap = pmap_registry_get (this); - if (port > 65535) + if (port > GF_PORT_MAX) goto out; p = port; @@ -248,7 +248,7 @@ pmap_registry_remove (xlator_t *this, int port, const char *brickname, goto out; if (port) { - if (port > 65535) + if (port > GF_PORT_MAX) goto out; p = port; -- cgit