From 8fe39cd4d978ec1bfb57dec0e192f5934122f384 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 10 Nov 2011 19:49:43 +0530 Subject: cluster/afr: honor the xattr set by data-self-heal Change-Id: I2b8c3a2d7771463ef94892f2a78fc464aba703ee BUG: 3805 Reviewed-on: http://review.gluster.com/708 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-common.c | 4 +++- xlators/cluster/afr/src/afr-self-heal-data.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 31632d7f3..80e5c043e 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -787,7 +787,9 @@ afr_lookup_build_response_params (afr_local_t *local, xlator_t *this) read_child = afr_read_child (this, local->cont.lookup.inode); gf_log (this->name, GF_LOG_DEBUG, "Building lookup response from %d", read_child); - *xattr = dict_ref (local->cont.lookup.xattrs[read_child]); + //honor the xattr set by data-self-heal + if (!*xattr) + *xattr = dict_ref (local->cont.lookup.xattrs[read_child]); *buf = local->cont.lookup.bufs[read_child]; *postparent = local->cont.lookup.postparents[read_child]; diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index d86dc6265..a2bc3bb58 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -678,6 +678,7 @@ afr_sh_data_fix (call_frame_t *frame, xlator_t *this) */ dict_unref (orig_local->cont.lookup.xattr); + orig_local->cont.lookup.xattr = NULL; if (orig_local->cont.lookup.xattrs) orig_local->cont.lookup.xattr = dict_ref (orig_local->cont.lookup.xattrs[sh->source]); -- cgit