summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-02-01 14:44:07 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-17 00:57:02 -0800
commit489a7a10fe2e00d00d86f0304145a4910bb94070 (patch)
tree1e2c28f5e124ae781a1c6dbbb3b33f3ad3d77ee8 /libglusterfs/src
parent7fa06c4ce1a44bbd89d3798193f173c057533bb6 (diff)
cli: Fix for statedump crashing gluster processes
1. Fixes the bug in statedump causing the gluster process to crash when an unknown option was given in the 'glusterdump.*.options' file. 2. Also fixes cli, making it send full statedump option strings even when only partial option strings are given in 'volume statedump' command. 3. Minor change to order of operations during statedump to allow option parsing errors to be written to the dump file. Change-Id: Ic878cbca4dbf46b83fba0fd88fcb3c03f05ae46d BUG: 772586 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/2706 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/statedump.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
index 8c6fe92158d..3811ef69234 100644
--- a/libglusterfs/src/statedump.c
+++ b/libglusterfs/src/statedump.c
@@ -529,12 +529,8 @@ gf_proc_dump_parse_set_option (char *key, char *value)
"matched key : %s\n", key);
ret = write (gf_dump_fd, buf, strlen (buf));
- /* warning suppression */
- if (ret >= 0) {
- ret = -1;
- goto out;
- }
-
+ ret = -1;
+ goto out;
}
opt_value = (strncasecmp (value, "yes", 3) ?
@@ -618,11 +614,11 @@ gf_proc_dump_info (int signum)
} else
strncpy (brick_name, "glusterdump", sizeof (brick_name));
- ret = gf_proc_dump_options_init (brick_name);
+ ret = gf_proc_dump_open (ctx->statedump_path, brick_name);
if (ret < 0)
goto out;
- ret = gf_proc_dump_open (ctx->statedump_path, brick_name);
+ ret = gf_proc_dump_options_init (brick_name);
if (ret < 0)
goto out;