From c85a3eee54b4028573c905829d5b46c0b6512c56 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Tue, 27 Nov 2012 12:05:28 +0530 Subject: cluster/dht: send ACCESS call on dir to first_up_subvol if cached is down Change-Id: I4f518a969bbe3a11075e7c9ae10bd21bf059d5f3 BUG: 867253 Signed-off-by: shishir gowda Reviewed-on: http://review.gluster.org/4240 Reviewed-by: Jeff Darcy Tested-by: Gluster Build System --- xlators/cluster/dht/src/dht-inode-read.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c index 7e29a7a8..f17cb73b 100644 --- a/xlators/cluster/dht/src/dht-inode-read.c +++ b/xlators/cluster/dht/src/dht-inode-read.c @@ -498,12 +498,23 @@ dht_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this, { int ret = -1; dht_local_t *local = NULL; + xlator_t *subvol = NULL; local = frame->local; if (local->call_cnt != 1) goto out; + if ((op_ret == -1) && (op_errno == ENOTCONN) && + IA_ISDIR(local->loc.inode->ia_type)) { + + subvol = dht_first_up_subvol (this); + if (!subvol) + goto out; + STACK_WIND (frame, dht_access_cbk, subvol, subvol->fops->access, + &local->loc, local->rebalance.flags, NULL); + return 0; + } if ((op_ret == -1) && (op_errno == ENOENT)) { /* File would be migrated to other node */ local->rebalance.target_op_fn = dht_access2; -- cgit