From 85ed82893aca7dd6307100660b9bba0233d52240 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Tue, 1 Dec 2009 06:11:06 +0000 Subject: cluster/afr: Don't do memcpy of afr_local_t in afr_local_copy. For the background self-heal frame's local_t, copy only required members --- not a wholesale memcpy. The memcpy lead to pointers being copied and then double free'd. Signed-off-by: Vikas Gorur Signed-off-by: Anand V. Avati BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320 --- xlators/cluster/afr/src/afr-self-heal-data.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index dfe586588..c8397b2ae 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -762,7 +762,8 @@ afr_self_heal_get_source (xlator_t *this, afr_local_t *local, dict_t **xattr) sh->pending_matrix[i] = CALLOC (sizeof (int32_t), priv->child_count); } - sh->sources = CALLOC (priv->child_count, sizeof (*sh->sources)); + + sh->sources = CALLOC (priv->child_count, sizeof (*sh->sources)); afr_sh_build_pending_matrix (priv, sh->pending_matrix, xattr, priv->child_count, AFR_DATA_TRANSACTION); -- cgit