summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-11-30 04:35:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-11-30 02:53:45 -0800
commitcc3967db49e5983f43530708c1eb4b2708546ad9 (patch)
treee6fba1700f5f59155b2545264a12fe9cc6f9e6ce /xlators/cluster/afr/src/afr.c
parentd21e0108638bdde5f46361aadb370061293c8146 (diff)
cluster/afr: Preserve generation number along with inode in lookup and creation fops.
This fixes fuse_create_cbk conflict warnings and random errors while running dbench (typically open handle failure with ENOENT). Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index b82f412bf69..98eaeb6ddff 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -567,14 +567,18 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this, struct stat *lookup_buf)
if (local->cont.lookup.ino) {
local->cont.lookup.buf.st_ino = local->cont.lookup.ino;
+ local->cont.lookup.buf.st_dev = local->cont.lookup.gen;
}
if (local->op_ret == 0) {
/* KLUDGE: assuming DHT will not itransform in
revalidate */
- if (local->cont.lookup.inode->ino)
+ if (local->cont.lookup.inode->ino) {
local->cont.lookup.buf.st_ino =
local->cont.lookup.inode->ino;
+ local->cont.lookup.buf.st_dev =
+ local->cont.lookup.inode->generation;
+ }
}
if (local->success_count && local->enoent_count) {
@@ -694,6 +698,7 @@ afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie,
afr_itransform (buf->st_ino,
priv->child_count,
first_up_child);
+ local->cont.lookup.gen = buf->st_dev;
}
if (local->success_count == 0) {
@@ -709,7 +714,6 @@ afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie,
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,
@@ -811,6 +815,7 @@ afr_revalidate_lookup_cbk (call_frame_t *frame, void *cookie,
afr_itransform (buf->st_ino,
priv->child_count,
first_up_child);
+ local->cont.lookup.gen = buf->st_dev;
}
/* in case of revalidate, we need to send stat of the