From 60615a0a78ab8bc93dd027c1338c588c4f3d49a7 Mon Sep 17 00:00:00 2001 From: Basavanagowda Kanur Date: Thu, 2 Apr 2009 06:08:17 +0530 Subject: cluster/replicate should propogate the ESTALE error to parent, when at least one subvolume returns ESTALE. Signed-off-by: Anand V. Avati --- xlators/cluster/afr/src/afr.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'xlators/cluster/afr/src/afr.c') 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); -- cgit