summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-06-12 05:11:53 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-06-12 07:32:27 -0700
commit26fbb96e454df1844fc73c1122c08c8ae405f824 (patch)
tree2b453e9b67c29df62a3517363eda07af92c0ed5e /libglusterfsclient
parent7aa062466f34cd1eee911d34bdb87591d410c399 (diff)
libglusterfsclient: Call inode_lookup to prevent pruning
This bug shows up while using unfs3 with replicate. The absence of an inode_lookup on a looked-up/created inode results in it getting pruned from the inode table. Consequently, a subsequent lookup for the inode results in a different inode number being returned by replicate. This breaks unfs3 because it tries to remember the inode numbers returned by two different stat-family calls. Resolves: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=11 Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index f5465c841fa..89a7dff8ac0 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -1588,7 +1588,7 @@ libgf_client_lookup_cbk (call_frame_t *frame,
parent = local->fop.lookup.loc->parent;
inode_link (inode, parent, local->fop.lookup.loc->name, buf);
- /* inode_lookup (inode); */
+ inode_lookup (inode);
} else {
if ((local->fop.lookup.is_revalidate == 0)
&& (op_errno == ENOENT)) {
@@ -1837,7 +1837,7 @@ libgf_client_lookup_async_cbk (call_frame_t *frame,
libgf_alloc_inode_ctx (ctx, inode);
libgf_update_iattr_cache (inode, LIBGF_UPDATE_ALL, stbuf);
- /* inode_lookup (inode); */
+ inode_lookup (inode);
} else {
if ((local->fop.lookup_cbk.is_revalidate == 0)
&& (op_errno == ENOENT)) {
@@ -2357,7 +2357,7 @@ libgf_client_creat (libglusterfs_client_ctx_t *ctx,
inode_link (libgf_inode, loc->parent, loc->name,
&stub->args.create_cbk.buf);
- /* inode_lookup (libgf_inode); */
+ inode_lookup (libgf_inode);
libgf_alloc_inode_ctx (ctx, libgf_inode);
libgf_update_iattr_cache (libgf_inode, LIBGF_UPDATE_ALL,
@@ -4400,7 +4400,7 @@ libgf_client_mkdir (libglusterfs_client_ctx_t *ctx,
inode_link (libgf_inode, loc->parent, loc->name,
&stub->args.mkdir_cbk.buf);
- /* inode_lookup (libgf_inode); */
+ inode_lookup (libgf_inode);
libgf_alloc_inode_ctx (ctx, libgf_inode);
libgf_update_iattr_cache (libgf_inode, LIBGF_UPDATE_ALL,
@@ -5229,6 +5229,7 @@ libgf_client_link (libglusterfs_client_ctx_t *ctx, loc_t *old, loc_t *new)
inode = stub->args.link_cbk.inode;
sbuf = &stub->args.link_cbk.buf;
inode_link (inode, new->parent, basename ((char *)new->path), sbuf);
+ inode_lookup (inode);
libgf_update_iattr_cache (inode, LIBGF_UPDATE_STAT, sbuf);
out:
@@ -5908,6 +5909,7 @@ libgf_client_mknod (libglusterfs_client_ctx_t *ctx, loc_t *loc, mode_t mode,
inode = stub->args.mknod_cbk.inode;
inode_link (inode, loc->parent, loc->name, &stub->args.mknod_cbk.buf);
+ inode_lookup (inode);
if (!libgf_alloc_inode_ctx (ctx, inode))
libgf_alloc_inode_ctx (ctx, inode);
@@ -6202,7 +6204,7 @@ libgf_client_symlink (libglusterfs_client_ctx_t *ctx, const char *linkpath,
inode = stub->args.symlink_cbk.inode;
inode_link (inode, loc->parent, loc->name,
&stub->args.symlink_cbk.buf);
-
+ inode_lookup (inode);
if (!libgf_get_inode_ctx (inode))
libgf_alloc_inode_ctx (ctx, inode);