From 77d8cfeab52cd19f3b70abd9c3a2c4bbc9219bff Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Thu, 11 Jun 2009 08:47:06 +0000 Subject: Do not fail over readdir in replicate. If readdir fails on a subvolume, do not fail-over to the next subvolume, since the order of entries and offsets won't be same on all subvolumes. Signed-off-by: Anand V. Avati --- xlators/cluster/afr/src/afr-dir-read.c | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'xlators/cluster/afr/src/afr-dir-read.c') diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index 4205c157d6e..f1638c7401e 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -156,9 +156,6 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie, gf_dirent_t * entry = NULL; - int unwind = 1; - int last_tried = -1; - int this_try = -1; int child_index = -1; priv = this->private; @@ -168,33 +165,15 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie, child_index = (long) cookie; - if (op_ret == -1) { - last_tried = local->cont.readdir.last_tried; - - if (all_tried (last_tried, priv->child_count)) { - goto out; - } - - this_try = ++local->cont.readdir.last_tried; - unwind = 0; - - STACK_WIND (frame, afr_readdir_cbk, - children[this_try], - children[this_try]->fops->readdir, - local->fd, local->cont.readdir.size, - local->cont.readdir.offset); - } - -out: - if (unwind) { + if (op_ret != -1) { list_for_each_entry (entry, &entries->list, list) { entry->d_ino = afr_itransform (entry->d_ino, priv->child_count, child_index); } - - AFR_STACK_UNWIND (frame, op_ret, op_errno, entries); - } + } + + AFR_STACK_UNWIND (frame, op_ret, op_errno, entries); return 0; } @@ -238,8 +217,6 @@ afr_readdir (call_frame_t *frame, xlator_t *this, goto out; } - local->cont.readdir.last_tried = call_child; - local->fd = fd_ref (fd); local->cont.readdir.size = size; local->cont.readdir.offset = offset; -- cgit