From d177372ee732acc3b2ce7a395d83f8c03ec19ce2 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Thu, 10 Jan 2013 10:49:08 -0500 Subject: afr: replace afr_more_important_error with afr_most_important_error afr_more_important_error() is written to return whether a new errno should override an existing errno for high-level operations that could span multiple sub-operations. It specifically prioritizes ESTALE over EIO over ENOENT, and otherwise defaults to the latest error passed having priority. This change preserves current behavior, but rewrites the logic to return the higher priority error of the existing and new errno. The purpose of the change is to make the logic a bit more clear and set the stage for future changes to make the logic flexible based on context. BUG: 892730 Change-Id: Id1aa48855dfb0507abc9d1ef22f2259b30472576 Signed-off-by: Brian Foster Reviewed-on: http://review.gluster.org/4375 Reviewed-by: Jeff Darcy Tested-by: Gluster Build System --- xlators/cluster/afr/src/afr-self-heal-common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index b5b42aecb0b..e7026081bda 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -112,8 +112,7 @@ void afr_sh_set_error (afr_self_heal_t *sh, int32_t op_errno) { sh->op_ret = -1; - if (afr_error_more_important (sh->op_errno, op_errno)) - sh->op_errno = op_errno; + sh->op_errno = afr_most_important_error(sh->op_errno, op_errno); } void -- cgit