From f067918725ead7276fa4f0bfa1dca1be3459378e Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 29 Dec 2011 11:58:21 +0530 Subject: cluster/afr: EIO should overwrite ENOENT in lookup In case if lookup decides there is a gfid-mismatch, some enoents and self-heal cant remove the stale entry, it tells lookup to unwind with EIO but since ENOENT has more priority it is not over-written, this patch fixes that case. BUG: 765528 Change-Id: Ida03685629be8126365d660a16d8f9252f7ca030 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/2675 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index d9c42cbcd..bb8afb35f 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -1462,8 +1462,9 @@ afr_error_more_important (int32_t old_errno, int32_t new_errno) if (old_errno == ESTALE) ret = _gf_false; - /* Nothing should overwrite ENOENT, except ESTALE */ - else if ((old_errno == ENOENT) && (new_errno != ESTALE)) + /* Nothing should overwrite ENOENT, except ESTALE/EIO*/ + else if ((old_errno == ENOENT) && (new_errno != ESTALE) + && (new_errno != EIO)) ret = _gf_false; return ret; -- cgit