summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-05-26 05:01:35 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-05-26 03:43:39 -0700
commitc1c18df3936b01ec4ea8b48b936c4087648f4b3b (patch)
tree0b995ed5ed5c9a427f44369696512843360d96a7 /xlators/cluster/afr/src
parent9a2e319114d70d076b2f219a56397e5793dc3bdf (diff)
Always do itransform of the inode number from the first up child.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index ab10df8fc..816656122 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -437,8 +437,10 @@ afr_lookup_cbk (call_frame_t *frame, void *cookie,
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
struct stat * lookup_buf = NULL;
- int call_count = -1;
- int child_index = -1;
+
+ int call_count = -1;
+ int child_index = -1;
+ int first_up_child = -1;
uint32_t open_fd_count = 0;
int ret = 0;
@@ -500,10 +502,11 @@ afr_lookup_cbk (call_frame_t *frame, void *cookie,
local->cont.lookup.xattr = dict_ref (xattr);
*lookup_buf = *buf;
- lookup_buf->st_ino = afr_itransform (buf->st_ino,
- priv->child_count,
- child_index);
+ lookup_buf->st_ino = afr_itransform (buf->st_ino,
+ priv->child_count,
+ child_index);
+
if (priv->read_child >= 0) {
afr_set_read_child (this,
local->cont.lookup.inode,
@@ -537,6 +540,15 @@ afr_lookup_cbk (call_frame_t *frame, void *cookie,
local->need_data_self_heal = 1;
}
+ first_up_child = afr_first_up_child (priv);
+
+ if (child_index == first_up_child) {
+ local->cont.lookup.buf.st_ino =
+ afr_itransform (buf->st_ino,
+ priv->child_count,
+ first_up_child);
+ }
+
if (child_index == local->read_child_index) {
/*
@@ -553,9 +565,6 @@ afr_lookup_cbk (call_frame_t *frame, void *cookie,
local->cont.lookup.xattr = dict_ref (xattr);
*lookup_buf = *buf;
- lookup_buf->st_ino = afr_itransform (buf->st_ino,
- priv->child_count,
- child_index);
if (priv->read_child >= 0) {
afr_set_read_child (this,