From b18221b582faca8e5ef1229bffe3b5ca17e4be11 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Thu, 16 Aug 2018 14:17:21 +0300 Subject: xlators/mgmt/glusterd/src/glusterd-brick-ops.c : reduce size or re-scope message variable The the error and/or message variable was either: - Reduced in size - from 2048 bytes to 64 bytes, for example. or - Changed in scope - defined in a smaller scope. Compile-tested only! Change-Id: Ib74e5f8f4c2978f670d4708e9382e97edf5df0a7 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 7925f6e5767..991a4d2b59e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -2721,7 +2721,6 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) int32_t i = 1; char key[64] = ""; int32_t flag = 0; - char err_str[4096] = ""; int need_rebalance = 0; int force = 0; gf1_op_commands cmd = 0; @@ -3097,6 +3096,7 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) * clear it ourselves because nobody else will. */ volinfo->decommission_in_progress = 1; + char err_str[4096] = ""; ret = glusterd_handle_defrag_start (volinfo, err_str, sizeof (err_str), defrag_cmd, @@ -3108,15 +3108,14 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) "failed to start the rebalance"); /* TBD: shouldn't we do more than print a message? */ volinfo->decommission_in_progress = 0; + if (op_errstr) + *op_errstr = gf_strdup (err_str); } } else { if (GLUSTERD_STATUS_STARTED == volinfo->status) ret = glusterd_svcs_manager (volinfo); } out: - if (ret && err_str[0] && op_errstr) - *op_errstr = gf_strdup (err_str); - GF_FREE (brick_tmpstr); if (bricks_dict) dict_unref (bricks_dict); -- cgit