summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-pmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c
index 192a1d95258..6a89a4fe6e3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-pmap.c
+++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c
@@ -115,7 +115,7 @@ pmap_registry_search (xlator_t *this, const char *brickname,
pmap = pmap_registry_get (this);
- for (p = pmap->base_port; p <= pmap->last_alloc; p++) {
+ for (p = pmap->last_alloc; p >= pmap->base_port; p--) {
if (!pmap->ports[p].brickname || pmap->ports[p].type != type)
continue;
@@ -142,7 +142,7 @@ pmap_registry_search_by_xprt (xlator_t *this, void *xprt,
pmap = pmap_registry_get (this);
- for (p = pmap->base_port; p <= pmap->last_alloc; p++) {
+ for (p = pmap->last_alloc; p >= pmap->base_port; p--) {
if (!pmap->ports[p].xprt)
continue;
if (pmap->ports[p].xprt == xprt &&