summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/rpc-lib/src/protocol-common.h4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-pmap.c15
2 files changed, 11 insertions, 8 deletions
diff --git a/rpc/rpc-lib/src/protocol-common.h b/rpc/rpc-lib/src/protocol-common.h
index e572273..cf98152 100644
--- a/rpc/rpc-lib/src/protocol-common.h
+++ b/rpc/rpc-lib/src/protocol-common.h
@@ -96,10 +96,10 @@ enum gf_aggregator_procnum {
enum gf_pmap_port_type {
GF_PMAP_PORT_FREE = 0,
- GF_PMAP_PORT_FOREIGN,
+ GF_PMAP_PORT_FOREIGN, /* it actually means, not sure who is using it, but it is in-use */
GF_PMAP_PORT_LEASED,
GF_PMAP_PORT_NONE,
- GF_PMAP_PORT_BRICKSERVER,
+ GF_PMAP_PORT_BRICKSERVER, /* port used by brick process */
};
typedef enum gf_pmap_port_type gf_pmap_port_type_t;
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c
index cd06248..46f0330 100644
--- a/xlators/mgmt/glusterd/src/glusterd-pmap.c
+++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c
@@ -185,13 +185,15 @@ pmap_registry_alloc (xlator_t *this)
pmap = pmap_registry_get (this);
for (p = pmap->last_alloc; p < 65535; p++) {
- if (pmap->ports[p].type != GF_PMAP_PORT_FREE)
- continue;
+ /* GF_PMAP_PORT_FOREIGN may be freed up ? */
+ if ((pmap->ports[p].type == GF_PMAP_PORT_FREE) ||
+ (pmap->ports[p].type == GF_PMAP_PORT_FOREIGN)) {
- if (pmap_port_isfree (p)) {
- pmap->ports[p].type = GF_PMAP_PORT_LEASED;
- port = p;
- break;
+ if (pmap_port_isfree (p)) {
+ pmap->ports[p].type = GF_PMAP_PORT_LEASED;
+ port = p;
+ break;
+ }
}
}
@@ -271,6 +273,7 @@ remove:
free (pmap->ports[p].brickname);
+ pmap->ports[p].type = GF_PMAP_PORT_FREE;
pmap->ports[p].brickname = NULL;
pmap->ports[p].xprt = NULL;