From 7ba6469eee3118cc4ece905d2538ef778320ae63 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 15 Dec 2015 18:48:20 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/12973 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr-self-heal-name.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'xlators/cluster') 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; } -- cgit