summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-08-16 14:17:21 +0300
committerAmar Tumballi <amarts@redhat.com>2018-08-23 03:49:50 +0000
commitb18221b582faca8e5ef1229bffe3b5ca17e4be11 (patch)
tree199e7355d4023a2d8115e921c3fe37e48d74c1a5 /xlators
parent6dbf510f3c764d17c5b3967de05fdfb33c9dca93 (diff)
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 <ykaul@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c7
1 files changed, 3 insertions, 4 deletions
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);