summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-12-15 18:48:20 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-12-18 00:53:55 -0800
commit1f93e47c8777f7df3e8b1e1a6f42a4c33cb1c513 (patch)
treeda298a8a066e7c4072d90bd6765469628a0ca16a /xlators
parent530533fe44f08f30d1230c65db0054be7c6d3281 (diff)
cluster/afr: During name heal, propagate EIO only on gfid or type mismatch
Backport of: http://review.gluster.org/#/c/12973/ When the disk associated with a brick returns EIO during lookup, chances are that name heal would return an EIO because one of the syncop_XXX() operations as part of it returned an EIO. This is inherently treated by afr_lookup_selfheal_wrap() as a split-brain and the lookup is aborted prematurely with EIO even if it succeeded on the other replica(s). Change-Id: I754fa59c585712b8037f98a8c3c1737a2167fa1b BUG: 1292046 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12979 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-name.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-name.c b/xlators/cluster/afr/src/afr-self-heal-name.c
index 190be64bf4f..6895d1256f7 100644
--- a/xlators/cluster/afr/src/afr-self-heal-name.c
+++ b/xlators/cluster/afr/src/afr-self-heal-name.c
@@ -421,9 +421,13 @@ __afr_selfheal_name_do (call_frame_t *frame, xlator_t *this, inode_t *parent,
source_is_empty = afr_selfheal_name_source_empty_check (this, replies,
sources,
source);
- if (source_is_empty)
- return __afr_selfheal_name_expunge (this, parent, pargfid,
+ if (source_is_empty) {
+ ret = __afr_selfheal_name_expunge (this, parent, pargfid,
bname, inode, replies);
+ if (ret == -EIO)
+ ret = -1;
+ return ret;
+ }
ret = afr_selfheal_name_type_mismatch_check (this, replies, source,
sources, pargfid, bname);
@@ -457,9 +461,13 @@ __afr_selfheal_name_do (call_frame_t *frame, xlator_t *this, inode_t *parent,
return -1;
}
- return __afr_selfheal_name_impunge (frame, this, parent, pargfid,
- bname, inode,
- replies, gfid_idx);
+ ret = __afr_selfheal_name_impunge (frame, this, parent, pargfid,
+ bname, inode,
+ replies, gfid_idx);
+ if (ret == -EIO)
+ ret = -1;
+
+ return ret;
}