summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
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:37:12 -0700
commit696428efb6195374bfd07c1b483871e1fdb68a55 (patch)
tree1864e1afc7ffb3c665a439a171d9f842af86a555 /xlators/cluster
parent0af126294a1eeb89383a4e477962f908f003026f (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')
-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,