summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-dir-read.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-06-11 08:47:06 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-06-11 07:35:36 -0700
commit77d8cfeab52cd19f3b70abd9c3a2c4bbc9219bff (patch)
tree8a217f70e8da0a7e68a05c0853f471eca06cdaec /xlators/cluster/afr/src/afr-dir-read.c
parent998a1e0f740b6730f7885ad8c74afaad503d3256 (diff)
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 <avati@dev.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-dir-read.c')
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c31
1 files changed, 4 insertions, 27 deletions
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;