From c8c0942d1c890fd9b74c8e2fb3897bc96f9b9b82 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. Change-Id: Icd68c4a5cf05dd97c568964ab647a34fdb6e26f4 BUG: 765528 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/2541 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 8720f8ab7..c00c80b9f 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -1773,8 +1773,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