summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
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-16 02:33:38 -0800
commit7ba6469eee3118cc4ece905d2538ef778320ae63 (patch)
treee6b809413b9bd700243f75293ef7b69435dc4ddb /xlators/cluster
parent6e635284a4411b816d4d860a28262c9e6dc4bd6a (diff)
cluster/afr: During name heal, propagate EIO only on gfid or type mismatch
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: Ib9b7f2974bff8e206897bb4f689f0482264c61e5 BUG: 1291701 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12973 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/cluster')
-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 b57acbe99e0..d8ac170f96c 100644
--- a/xlators/cluster/afr/src/afr-self-heal-name.c
+++ b/xlators/cluster/afr/src/afr-self-heal-name.c
@@ -416,9 +416,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);
@@ -452,9 +456,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;
}