From 489a7a10fe2e00d00d86f0304145a4910bb94070 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Wed, 1 Feb 2012 14:44:07 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/2706 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/statedump.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'libglusterfs/src/statedump.c') diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index 8c6fe92158..3811ef6923 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; -- cgit