From bc3cad79cd0cf48318e723fd3377af979673374e Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 16 Nov 2010 01:26:45 +0000 Subject: fuse: dentry create time inode resolution fixes treat successful 'inode' resolution as stale entries in case of entry creation fops, instead of continueing with an error log with old entry. Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 1240 (DVM: after graph change, inodes should resolve to new inode-table) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1240 --- xlators/mount/fuse/src/fuse-bridge.c | 50 +++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 3342ac577de..dfa6b899a71 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -1016,10 +1016,12 @@ fuse_mknod_resume (fuse_state_t *state) return; } - if (!state->loc.inode) - state->loc.inode = inode_new (state->loc.parent->table); - else - gf_log (state->this->name, GF_LOG_ERROR, "inode already present"); + if (state->loc.inode) { + gf_log (state->this->name, GF_LOG_DEBUG, "inode already present"); + inode_unref (state->loc.inode); + } + + state->loc.inode = inode_new (state->loc.parent->table); gf_log ("glusterfs-fuse", GF_LOG_TRACE, "%"PRIu64": MKNOD %s", state->finh->unique, @@ -1079,10 +1081,12 @@ fuse_mkdir_resume (fuse_state_t *state) return; } - if (!state->loc.inode) - state->loc.inode = inode_new (state->loc.parent->table); - else - gf_log (state->this->name, GF_LOG_ERROR, "inode already present"); + if (state->loc.inode) { + gf_log (state->this->name, GF_LOG_DEBUG, "inode already present"); + inode_unref (state->loc.inode); + } + + state->loc.inode = inode_new (state->loc.parent->table); gf_log ("glusterfs-fuse", GF_LOG_TRACE, "%"PRIu64": MKDIR %s", state->finh->unique, @@ -1216,10 +1220,12 @@ fuse_symlink_resume (fuse_state_t *state) return; } - if (!state->loc.inode) - state->loc.inode = inode_new (state->loc.parent->table); - else - gf_log (state->this->name, GF_LOG_ERROR, "inode already present"); + if (state->loc.inode) { + gf_log (state->this->name, GF_LOG_DEBUG, "inode already present"); + inode_unref (state->loc.inode); + } + + state->loc.inode = inode_new (state->loc.parent->table); gf_log ("glusterfs-fuse", GF_LOG_TRACE, "%"PRIu64": SYMLINK %s -> %s", state->finh->unique, @@ -1366,10 +1372,12 @@ fuse_rename (xlator_t *this, fuse_in_header_t *finh, void *msg) void fuse_link_resume (fuse_state_t *state) { - if (!state->loc.inode) - state->loc.inode = inode_ref (state->loc2.inode); - else - gf_log (state->this->name, GF_LOG_ERROR, "inode already present"); + if (state->loc.inode) { + gf_log (state->this->name, GF_LOG_DEBUG, "inode already present"); + inode_unref (state->loc.inode); + } + + state->loc.inode = inode_ref (state->loc2.inode); gf_log ("glusterfs-fuse", GF_LOG_TRACE, "%"PRIu64": LINK() %s (%"PRId64") -> %s (%"PRId64")", @@ -1523,10 +1531,12 @@ fuse_create_resume (fuse_state_t *state) return; } - if (!state->loc.inode) - state->loc.inode = inode_new (state->loc.parent->table); - else - gf_log (state->this->name, GF_LOG_ERROR, "inode already present"); + if (state->loc.inode) { + gf_log (state->this->name, GF_LOG_DEBUG, "inode already present"); + inode_unref (state->loc.inode); + } + + state->loc.inode = inode_new (state->loc.parent->table); fd = fd_create (state->loc.inode, state->finh->pid); state->fd = fd; -- cgit