21ab4e
From 5a63e4c828a17654df36aa4c27a67eaf3f63ca5a Mon Sep 17 00:00:00 2001
21ab4e
From: Mohit Agrawal <moagrawa@redhat.com>
21ab4e
Date: Wed, 8 Feb 2017 12:20:55 +0530
21ab4e
Subject: [PATCH 363/369] glusterd: glusterd is crashed at the time of stop
21ab4e
 volume
21ab4e
21ab4e
Problem: glusterd is crashed at the time of stop volume due to
21ab4e
         overflow of pidfile array after build rpm with default options.
21ab4e
21ab4e
Solution: To avoid the crash update the pidfile array size.
21ab4e
21ab4e
Test:    To test the patch followed below procedure
21ab4e
         1) Setup 1*2 environment and start the volume
21ab4e
         2) Stop the volume
21ab4e
         Before apply the patch glusterd is crashed.
21ab4e
21ab4e
Note:  The crash is happened only after build rpm with rpmbuild -ba
21ab4e
       <spec> because _FORTIFY_SOURCE is enabled. This option tries to
21ab4e
       figure out possible overflow scenarios like the bug here and
21ab4e
       crash the process.
21ab4e
21ab4e
>Reviewed-on: https://review.gluster.org/16560
21ab4e
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
21ab4e
>Smoke: Gluster Build System <jenkins@build.gluster.org>
21ab4e
>Reviewed-by: N Balachandran <nbalacha@redhat.com>
21ab4e
>Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
21ab4e
21ab4e
BUG: 1437957
21ab4e
Change-Id: I58a006bc0727843a7ed02a10b4ebd5dca39eae67
21ab4e
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
21ab4e
Reviewed-on: https://code.engineering.redhat.com/gerrit/102294
21ab4e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
Tested-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
---
21ab4e
 xlators/mgmt/glusterd/src/glusterd-op-sm.c | 4 ++--
21ab4e
 1 file changed, 2 insertions(+), 2 deletions(-)
21ab4e
21ab4e
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
21ab4e
index b07fa30..98ae7b6 100644
21ab4e
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
21ab4e
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
21ab4e
@@ -6076,7 +6076,7 @@ glusterd_bricks_select_stop_volume (dict_t *dict, char **op_errstr,
21ab4e
         glusterd_brickinfo_t                    *brickinfo = NULL;
21ab4e
         glusterd_pending_node_t                 *pending_node = NULL;
21ab4e
         glusterd_conf_t                         *conf = THIS->private;
21ab4e
-        char                                    pidfile[1024];
21ab4e
+        char                                    pidfile[PATH_MAX] = {0,};
21ab4e
 
21ab4e
         ret = glusterd_op_stop_volume_args_get (dict, &volname, &flags);
21ab4e
         if (ret)
21ab4e
@@ -6140,7 +6140,7 @@ glusterd_bricks_select_remove_brick (dict_t *dict, char **op_errstr,
21ab4e
         int32_t                                 command = 0;
21ab4e
         int32_t                                 force = 0;
21ab4e
         glusterd_conf_t                         *conf = THIS->private;
21ab4e
-        char                                    pidfile[1024];
21ab4e
+        char                                    pidfile[PATH_MAX] = {0,};
21ab4e
 
21ab4e
         ret = dict_get_str (dict, "volname", &volname);
21ab4e
 
21ab4e
-- 
21ab4e
1.8.3.1
21ab4e