From b80a2a150b874031df35af8d4f06657906024861 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 27 Sep 2011 14:44:01 +0530 Subject: cluster/afr: Handle files without gfid Change-Id: Ie831ae8542c1382c17fb7837cd18b0e4e4d3db75 BUG: 3734 Reviewed-on: http://review.gluster.com/619 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-self-heal-data.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (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 6ce710669..11d6745b4 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -812,11 +812,8 @@ afr_lookup_select_read_child_by_txn_type (xlator_t *this, afr_local_t *local, if (NULL == pending_matrix) goto out; - sources = GF_CALLOC (sizeof (*sources), priv->child_count, - gf_afr_mt_int32_t); - if (NULL == sources) - goto out; - + sources = local->cont.lookup.sources; + memset (sources, 0, sizeof (*sources) * priv->child_count); afr_build_pending_matrix (priv->pending_key, pending_matrix, xattr, txn_type, priv->child_count); @@ -840,13 +837,8 @@ afr_lookup_select_read_child_by_txn_type (xlator_t *this, afr_local_t *local, config_read_child, valid_children); ret = 0; - local->cont.lookup.sources = sources; out: afr_destroy_pending_matrix (pending_matrix, priv->child_count); - if (-1 == ret) { - if (sources) - GF_FREE (sources); - } gf_log (this->name, GF_LOG_DEBUG, "returning read_child: %d", read_child); return read_child; } -- cgit