From 1f93e47c8777f7df3e8b1e1a6f42a4c33cb1c513 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 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 Reviewed-on: http://review.gluster.org/12979 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/afr') 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; } -- cgit