diff options
author | Anuradha <atalur@redhat.com> | 2014-09-26 14:18:05 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2014-09-29 02:58:23 -0700 |
commit | 3ba5f1d38d58e72d562f6d19498bed00fb2727bc (patch) | |
tree | 9dc4a4e6544eb1a2742c6b849f1475cb94d14ebf /xlators/cluster/afr/src | |
parent | 37ee11f4d42bff1f46fae7d2755e0d6d8a55e572 (diff) |
cluster/afr : Fix incorrect looping of index healer
Sending appropriate return value from afr_selfheal()
fixes the issue.
Credits : Krutika Dhananjay and Pranith Kumar.
Change-Id: I01dbd49476f6bfbd02028fdde1f60cc0324a1e39
BUG: 1146812
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/8868
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index eeaceb13018..ddccc7f38ed 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1068,7 +1068,7 @@ afr_selfheal (xlator_t *this, uuid_t gfid) { inode_t *inode = NULL; call_frame_t *frame = NULL; - int ret = -1; + int ret = -1, entry_ret = 0, metadata_ret = 0, data_ret = 0; gf_boolean_t data_selfheal = _gf_false; gf_boolean_t metadata_selfheal = _gf_false; gf_boolean_t entry_selfheal = _gf_false; @@ -1085,13 +1085,18 @@ afr_selfheal (xlator_t *this, uuid_t gfid) goto out; if (data_selfheal) - afr_selfheal_data (frame, this, inode); + data_ret = afr_selfheal_data (frame, this, inode); if (metadata_selfheal) - afr_selfheal_metadata (frame, this, inode); + metadata_ret = afr_selfheal_metadata (frame, this, inode); if (entry_selfheal) - afr_selfheal_entry (frame, this, inode); + entry_ret = afr_selfheal_entry (frame, this, inode); + + if (data_ret == -EIO || metadata_ret == -EIO || entry_ret == -EIO) + ret = -EIO; + else + ret = (data_ret | metadata_ret | entry_ret); inode_forget (inode, 1); inode_unref (inode); |