summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-data.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-12-01 06:11:06 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-01 06:30:07 -0800
commit85ed82893aca7dd6307100660b9bba0233d52240 (patch)
treebf54bd1c7ad5d713f74c212cc1dbaa30d752dbc4 /xlators/cluster/afr/src/afr-self-heal-data.c
parentcc57da87504621655d4acb7ec65e27f45b2b72d1 (diff)
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 <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c3
1 files changed, 2 insertions, 1 deletions
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);