diff options
author | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2016-04-30 14:02:01 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-05-01 00:44:58 -0700 |
commit | 1737a475156124ead29fbae140df92e2f6e7a49e (patch) | |
tree | 8908348d093bcfce66610ca08025079ab0adb74a /xlators | |
parent | 4bba976e7a61d9961a133b2b61e56eb0871d3ba2 (diff) |
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 <prasanna.kalever@redhat.com>
> Reviewed-on: http://review.gluster.org/14096
> Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com>
> Smoke: Gluster Build System <jenkins@build.gluster.com>
> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Change-Id: Idf07dd5d08957aed9287e7df2f3fc6f0f32039c1
BUG: 1331772
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Reviewed-on: http://review.gluster.org/14127
Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-pmap.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; |