From 1b499e9dfe63ce051a071cacc19e3161b7a32636 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Mon, 27 Aug 2018 12:18:21 +0530 Subject: glusterd: glusterd_brick_start shouldn't cleanup pidfile if only_connect is true Problem: Sometime glusterd cleanup pidfile even brick is started and cli shows volume status "N/A" Solution: Update the condition in glusterd_brick_start to avoid pidfile cleanup in case if only_connect flag is true Fixes: bz#1622422 Change-Id: I8decb34597126b848e3a44d957e138833dd97350 Signed-off-by: Mohit Agrawal --- xlators/mgmt/glusterd/src/glusterd-utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 40fd4bb83f2..9a3353a1e50 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -6177,6 +6177,8 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo, brickpath = search_brick_path_from_proc (pid, brickinfo->path); if (!brickpath) { + if (only_connect) + return 0; gf_log (this->name, GF_LOG_INFO, "Either pid %d is not running or brick" " path %s is not consumed so cleanup pidfile", @@ -6187,14 +6189,14 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo, if (sys_access (pidfile , R_OK) == 0) { sys_unlink (pidfile); } - if (only_connect) - return 0; goto run; } GF_FREE (brickpath); ret = glusterd_get_sock_from_brick_pid (pid, socketpath, sizeof(socketpath)); if (ret) { + if (only_connect) + return 0; gf_log (this->name, GF_LOG_INFO, "Either pid %d is not running or does " "not match with any running brick " @@ -6203,8 +6205,6 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo, if (sys_access (pidfile , R_OK) == 0) { sys_unlink (pidfile); } - if (only_connect) - return 0; goto run; } } -- cgit