summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawa@redhat.com>2017-02-08 12:20:55 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-09 07:32:39 -0500
commit94374de6984da45e668d81a3794aa8137aabeb0f (patch)
tree6659b988f27fb22d7eff860d5d5149c1d8599e2f
parent0b3255e0ce1d4d407467b34f7d6ad91161b43cfc (diff)
glusterd: glusterd is crashed at the time of stop volume
Problem: glusterd is crashed at the time of stop volume due to overflow of pidfile array after build rpm with default options. Solution: To avoid the crash update the pidfile array size. Test: To test the patch followed below procedure 1) Setup 1*2 environment and start the volume 2) Stop the volume Before apply the patch glusterd is crashed. Note: The crash is happened only after build rpm with rpmbuild -ba <spec> because _FORTIFY_SOURCE is enabled. This option tries to figure out possible overflow scenarios like the bug here and crash the process. > BUG: 1420202 > Change-Id: I58a006bc0727843a7ed02a10b4ebd5dca39eae67 > Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> > Reviewed-on: https://review.gluster.org/16560 > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>1420606 > Smoke: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: N Balachandran <nbalacha@redhat.com> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > (cherry picked from commit 9ac193a19b0ca6d6548aeafa5c915b26396f8697) Change-Id: I4bcfe830e789a9b95fbcace4495bfda17dca0269 BUG: 1420606 Reviewed-on: https://review.gluster.org/16571 Tested-by: MOHIT AGRAWAL <moagrawa@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 6bc01f702cc..8e73d9072ab 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -6143,7 +6143,7 @@ glusterd_bricks_select_stop_volume (dict_t *dict, char **op_errstr,
glusterd_brickinfo_t *brickinfo = NULL;
glusterd_pending_node_t *pending_node = NULL;
glusterd_conf_t *conf = THIS->private;
- char pidfile[1024];
+ char pidfile[PATH_MAX] = {0,};
ret = glusterd_op_stop_volume_args_get (dict, &volname, &flags);
if (ret)
@@ -6207,7 +6207,7 @@ glusterd_bricks_select_remove_brick (dict_t *dict, char **op_errstr,
int32_t command = 0;
int32_t force = 0;
glusterd_conf_t *conf = THIS->private;
- char pidfile[1024];
+ char pidfile[PATH_MAX] = {0,};
ret = dict_get_str (dict, "volname", &volname);