summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mount/fuse/src/fuse-resolve.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c
index 7e9014cf2bf..9e38cbe7e40 100644
--- a/xlators/mount/fuse/src/fuse-resolve.c
+++ b/xlators/mount/fuse/src/fuse-resolve.c
@@ -88,8 +88,12 @@ fuse_resolve_entry (fuse_state_t *state)
resolve_loc->parent = inode_ref (state->loc_now->parent);
gf_uuid_copy (resolve_loc->pargfid, state->loc_now->pargfid);
resolve_loc->name = resolve->bname;
- resolve_loc->inode = inode_new (state->itable);
+ resolve_loc->inode = inode_grep (state->itable, resolve->parhint,
+ resolve->bname);
+ if (!resolve_loc->inode) {
+ resolve_loc->inode = inode_new (state->itable);
+ }
inode_path (resolve_loc->parent, resolve_loc->name,
(char **) &resolve_loc->path);
@@ -108,7 +112,8 @@ fuse_resolve_gfid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
fuse_state_t *state = NULL;
fuse_resolve_t *resolve = NULL;
inode_t *link_inode = NULL;
- loc_t *loc_now = NULL;
+ loc_t *loc_now = NULL;
+ inode_t *tmp_inode = NULL;
state = frame->root->state;
resolve = state->resolve_now;
@@ -155,6 +160,13 @@ fuse_resolve_gfid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
loc_now->parent = link_inode;
gf_uuid_copy (loc_now->pargfid, link_inode->gfid);
+ tmp_inode = inode_grep (state->itable, link_inode, resolve->bname);
+ if (tmp_inode && (!inode_needs_lookup (tmp_inode, THIS))) {
+ loc_now->inode = tmp_inode;
+ goto out;
+ }
+
+ inode_unref (tmp_inode);
fuse_resolve_entry (state);
return 0;
@@ -236,6 +248,10 @@ fuse_resolve_parent_simple (fuse_state_t *state)
* we took the conservative approach of assuming entry should
* have been there even though it need not have (bug #804592).
*/
+
+ if (loc->inode && inode_needs_lookup (loc->inode, THIS))
+ return -1;
+
if ((loc->inode == NULL)
&& __is_root_gfid (parent->gfid)) {
/* non decisive result - entry missing */