summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index d5e181a5dd3..f74deab6df3 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -157,12 +157,15 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie,
int unwind = 1;
int last_tried = -1;
int this_try = -1;
+ int child_index = -1;
priv = this->private;
children = priv->children;
local = frame->local;
+ child_index = (long) cookie;
+
if (op_ret == -1) {
last_tried = local->cont.readdir.last_tried;
@@ -182,6 +185,9 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
+ buf->d_ino = afr_itransform (buf->d_ino, priv->child_count,
+ child_index);
+
AFR_STACK_UNWIND (frame, op_ret, op_errno, buf);
}
@@ -233,9 +239,10 @@ afr_readdir (call_frame_t *frame, xlator_t *this,
local->cont.readdir.size = size;
local->cont.readdir.offset = offset;
- STACK_WIND (frame, afr_readdir_cbk,
- children[call_child], children[call_child]->fops->readdir,
- fd, size, offset);
+ STACK_WIND_COOKIE (frame, afr_readdir_cbk, (void *) (long) call_child,
+ children[call_child],
+ children[call_child]->fops->readdir,
+ fd, size, offset);
op_ret = 0;
out: