From 6c4325ca57bca72d10e5172f8423262cdb3a379c Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Thu, 21 Aug 2014 17:27:17 +0530 Subject: cluster/afr: Propagate EIO on inode's type mismatch Original author of the test script: Pranith Kumar K Change-Id: If515ecefd3c17f85f175b6a8cb4b78ce8c916de2 BUG: 1132469 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/8574 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr-common.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'xlators/cluster/afr/src/afr-common.c') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 8ab67af405f..2a6b0c957fb 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -1219,9 +1219,8 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this) continue; } - if (!uuid_compare (replies[i].poststat.ia_gfid, - read_gfid)) - continue; + if (!uuid_compare (replies[i].poststat.ia_gfid, read_gfid)) + continue; can_interpret = _gf_false; @@ -1442,6 +1441,7 @@ afr_attempt_local_discovery (xlator_t *this, int32_t child_index) int afr_lookup_selfheal_wrap (void *opaque) { + int ret = 0; call_frame_t *frame = opaque; afr_local_t *local = NULL; xlator_t *this = NULL; @@ -1450,19 +1450,25 @@ afr_lookup_selfheal_wrap (void *opaque) local = frame->local; this = frame->this; - afr_selfheal_name (frame->this, local->loc.pargfid, local->loc.name, - &local->cont.lookup.gfid_req); + ret = afr_selfheal_name (frame->this, local->loc.pargfid, + local->loc.name, &local->cont.lookup.gfid_req); + if (ret == -EIO) + goto unwind; afr_local_replies_wipe (local, this->private); inode = afr_selfheal_unlocked_lookup_on (frame, local->loc.parent, local->loc.name, local->replies, - local->child_up); + local->child_up, NULL); if (inode) inode_unref (inode); + afr_lookup_done (frame, this); + return 0; - return 0; +unwind: + AFR_STACK_UNWIND (lookup, frame, -1, EIO, NULL, NULL, NULL, NULL); + return 0; } -- cgit