diff options
| author | Basavanagowda Kanur <gowda@gluster.com> | 2009-04-02 06:08:17 +0530 | 
|---|---|---|
| committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-02 18:09:32 +0530 | 
| commit | 60615a0a78ab8bc93dd027c1338c588c4f3d49a7 (patch) | |
| tree | 0e8ba8f2e953f0f91050fa1389159ebbfc672969 | |
| parent | 705c7c9bacafc22b714ac15e3925cb5eaeb45b0a (diff) | |
cluster/replicate should propogate the ESTALE error to parent, when at least one subvolume returns ESTALE.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
| -rw-r--r-- | xlators/cluster/afr/src/afr.c | 18 | 
1 files changed, 14 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 73cc5686d3b..a5acead580d 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -355,9 +355,18 @@ afr_lookup_cbk (call_frame_t *frame, void *cookie,  			if (op_errno == ENOENT)  				local->enoent_count++; -			if (op_errno != ENOTCONN) -				local->op_errno = op_errno; - +			if (op_errno != ENOTCONN) { +                                if (local->op_errno != ESTALE) +                                        local->op_errno = op_errno; +                        } + +                        if (op_errno == ESTALE) { +                                /* no matter what other subvolumes return for +                                 * this call, ESTALE _must_ be sent to parent +                                 */ +                                local->op_ret = -1; +                                local->op_errno = ESTALE; +                        }  			goto unlock;  		} @@ -383,7 +392,8 @@ afr_lookup_cbk (call_frame_t *frame, void *cookie,  		/* inode number should be preserved across revalidates */  		if (local->success_count == 0) { -			local->op_ret   = op_ret; +                        if (local->op_errno != ESTALE) +                                local->op_ret   = op_ret;  			local->cont.lookup.inode = inode;  			local->cont.lookup.xattr = dict_ref (xattr);  | 
