summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index f90abc19b2e..86b22f8efbe 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -5170,12 +5170,12 @@ glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo,
int ret = -1;
int32_t pid = -1;
- int32_t brick_online = -1;
char key[1024] = {0};
char base_key[1024] = {0};
char pidfile[PATH_MAX] = {0};
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
+ gf_boolean_t brick_online = _gf_false;
GF_ASSERT (volinfo);
GF_ASSERT (brickinfo);
@@ -5230,7 +5230,9 @@ glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo,
GLUSTERD_GET_BRICK_PIDFILE (pidfile, volinfo, brickinfo, priv);
- brick_online = gf_is_service_running (pidfile, &pid);
+ if (glusterd_is_brick_started (brickinfo)) {
+ brick_online = gf_is_service_running (pidfile, &pid);
+ }
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.pid", base_key);