diff options
| author | Krutika Dhananjay <kdhananj@redhat.com> | 2014-08-21 17:27:17 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-16 04:26:40 -0700 | 
| commit | dfaf76cffe37183c1b8072961b085f705c1c978f (patch) | |
| tree | 82826604c29d3a8328486858378427a6ab0727e1 /xlators/cluster/afr/src/afr-common.c | |
| parent | cd5a5d32996d2f1141adac94816ad2292a693ebf (diff) | |
cluster/afr: Propagate EIO on inode's type mismatch
        Backport of: http://review.gluster.org/8574, and
                     http://review.gluster.org/8586
Original author of the test script:
            Pranith Kumar K <pkarampu@redhat.com>
Change-Id: I0c32bdd8e666f8175c0a8fbf940934e6ce469931
BUG: 1136830
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8706
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
| -rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 20 | 
1 files changed, 13 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index be1d226270a..e8e6e929c60 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;  }  | 
