From e730d7fd8d1fff6d8350173d178761edc460f02d Mon Sep 17 00:00:00 2001 From: Pranith K Date: Thu, 7 Jul 2011 05:04:29 +0000 Subject: cluster/afr: previous read_child should take precedence over priv->read_child Lookup uses the sources array to decide if a child is read_child or not. So if afr_mark_sources returns 0 i.e. all children are sources, explicitly mark them as sources. Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 3138 ([release-3.2]: ls shows 2 entries) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3138 --- xlators/cluster/afr/src/afr-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/afr/src/afr-common.c') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index aa88d609837..30986b589c8 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -700,7 +700,7 @@ afr_lookup_set_read_child (xlator_t *this, afr_local_t *local) if (!sh->sources) goto out; - read_child = priv->read_child; + read_child = local->read_child_index; if (afr_is_valid_read_child (sh->sources, priv->child_count, read_child)) goto out; @@ -931,6 +931,8 @@ afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie, afr_set_read_child (this, local->cont.lookup.inode, child_index); + //prefer fast child + local->read_child_index = child_index; } } else { -- cgit