summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorGaurav Kumar Garg <ggarg@redhat.com>2015-05-21 17:13:54 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-06-04 15:48:27 -0700
commit1d0db2e1548ff08cac93e3a5c735a73b92e18791 (patch)
tree433feaa3c957fe448def814f171d331a73a537da /xlators/mgmt/glusterd
parent7aa52673cc70011750ff019cefad8e0229f892ad (diff)
glusterd: do not show pid of brick in volume status if brick is down.
glusterd is currently showing pid of brick in volume status if brick goes down. It should not show pid of brick if brick is down. Change-Id: I077100d96de381695b338382808bd8c37bf625c7 BUG: 1228065 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10877 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Nekkunti <anekkunt@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> (cherry picked from commit 1a0d76fa14ee88ce17e017c3ceb311417870e944) Reviewed-on: http://review.gluster.org/11080
Diffstat (limited to 'xlators/mgmt/glusterd')
-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);