summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.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-common.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-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 327cab032f7..721f69a8d20 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1393,7 +1393,9 @@ afr_local_t *afr_local_copy (afr_local_t *l, xlator_t *this)
lc = CALLOC (1, sizeof (afr_local_t));
- memcpy (lc, l, sizeof (afr_local_t));
+// memcpy (lc, l, sizeof (afr_local_t));
+
+ lc->self_heal = l->self_heal;
if (l->loc.path)
loc_copy (&lc->loc, &l->loc);
@@ -1403,8 +1405,8 @@ afr_local_t *afr_local_copy (afr_local_t *l, xlator_t *this)
lc->xattr_req = dict_copy_with_ref (l->xattr_req, NULL);
lc->cont.lookup.inode = l->cont.lookup.inode;
- if (l->cont.lookup.xattr)
- lc->cont.lookup.xattr = dict_copy_with_ref (l->cont.lookup.xattr, NULL);
+// if (l->cont.lookup.xattr)
+// lc->cont.lookup.xattr = dict_copy_with_ref (l->cont.lookup.xattr, NULL);
return lc;
}
@@ -1440,14 +1442,6 @@ afr_self_heal_completion_cbk (call_frame_t *bgsh_frame, xlator_t *this)
UNLOCK (&priv->lock);
}
- /*
- * XXX Hack: Due to memcpy'ing of local, some pointers will
- * also have ended up in bgsh_frame's local. We shouldn't free
- * them. So set them to NULL here.
- */
-
- local->cont.writev.vector = NULL;
-
AFR_STACK_DESTROY (bgsh_frame);
return 0;