diff options
author | Pranith K <pranithk@gluster.com> | 2011-06-17 07:20:08 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-12 05:37:45 -0700 |
commit | 1a82b4539b69390dfb1a158c420385c7ad5d999f (patch) | |
tree | fc1145204199e48ff7f1eb3a52be700eabb4d8bf /xlators/cluster/afr/src/afr-self-heal-metadata.c | |
parent | 9866f23b9b0ceb8be876600be9832987b8646540 (diff) |
cluster/afr: Handle lookups when self-heal is off
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2586 (read child is set without checking the xattr)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2586
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-metadata.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-metadata.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 7ad1ce69a01..fe1db60e2e4 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -475,17 +475,15 @@ afr_sh_metadata_fix (call_frame_t *frame, xlator_t *this) sh = &local->self_heal; priv = this->private; - afr_sh_build_pending_matrix (priv, sh->pending_matrix, sh->xattr, - priv->child_count, - AFR_METADATA_TRANSACTION); + afr_build_pending_matrix (priv->pending_key, sh->pending_matrix, + sh->xattr, AFR_METADATA_TRANSACTION, + priv->child_count); afr_sh_print_pending_matrix (sh->pending_matrix, this); - nsources = afr_sh_mark_sources (sh, priv->child_count, - AFR_SELF_HEAL_METADATA); - - afr_sh_supress_errenous_children (sh->sources, sh->child_errno, - priv->child_count); + nsources = afr_mark_sources (sh->sources, sh->pending_matrix, sh->buf, + priv->child_count, AFR_SELF_HEAL_METADATA, + sh->child_success, this->name); if (nsources == 0) { gf_log (this->name, GF_LOG_TRACE, @@ -584,6 +582,8 @@ afr_sh_metadata_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, sh->buf[child_index] = *buf; if (xattr) sh->xattr[child_index] = dict_ref (xattr); + sh->child_success[sh->success_count] = child_index; + sh->success_count++; } else { gf_log (this->name, GF_LOG_INFO, "path %s on subvolume %s => -1 (%s)", @@ -614,9 +614,11 @@ afr_sh_metadata_lookup (call_frame_t *frame, xlator_t *this) int call_count = 0; dict_t *xattr_req = NULL; int ret = 0; + afr_self_heal_t *sh = NULL; local = frame->local; priv = this->private; + sh = &local->self_heal; call_count = afr_up_children_count (priv->child_count, local->child_up); @@ -635,6 +637,9 @@ afr_sh_metadata_lookup (call_frame_t *frame, xlator_t *this) } } + for (i = 0; i < priv->child_count; i++) + sh->child_success[i] = -1; + sh->success_count = 0; for (i = 0; i < priv->child_count; i++) { if (local->child_up[i]) { gf_log (this->name, GF_LOG_TRACE, |