summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-11-16 01:26:45 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-11-15 23:46:00 -0800
commitbc3cad79cd0cf48318e723fd3377af979673374e (patch)
treec7ec1fb9f9ebbd2f50faeec60d9fa36f01aa1e1b
parente10f1ec908139d9778406d07274dd390b7f56bc8 (diff)
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 <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> 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
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 3342ac577..dfa6b899a 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;