From e325479cf222d2f25dbc0a4c6b80bfe5a7f09f43 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Thu, 30 Mar 2017 14:47:45 +0530 Subject: glusterd: reset pid to -1 if brick is not online While populating brick details in gluster volume status response payload if a brick is not online then pid should be reset back to -1 so that volume status output doesn't show up the pid which was not cleaned up especially with brick multiplexing where multiple bricks belong to same process. Change-Id: Iba346da9a8cb5b5f5dd38031d4c5ef2097808387 BUG: 1437494 Signed-off-by: Atin Mukherjee Reviewed-on: https://review.gluster.org/16971 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Gaurav Yadav Reviewed-by: Prashanth Pai Reviewed-by: Jeff Darcy --- xlators/mgmt/glusterd/src/glusterd-utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index a0df27c8bae..fbec4fcafb8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -6358,6 +6358,8 @@ glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo, if (glusterd_is_brick_started (brickinfo)) { if (gf_is_service_running (pidfile, &pid)) { brick_online = _gf_true; + } else { + pid = -1; } } -- cgit