diff options
author | Gaurav Kumar Garg <ggarg@redhat.com> | 2015-05-21 17:13:54 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-06-03 23:59:58 -0700 |
commit | 1a0d76fa14ee88ce17e017c3ceb311417870e944 (patch) | |
tree | edcd9bac99b204d7e7cc77418440014b8939004a /xlators/mgmt | |
parent | 79d8916929f7d5b85a09ae9b75eadf945a3e11fb (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: 1223772
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>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 6 |
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 cc409fc632f..0ff70bdfd78 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5166,12 +5166,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); @@ -5226,7 +5226,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); |