summaryrefslogtreecommitdiffstats
path: root/xlators/mount
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-08-12 14:30:27 +0530
committerDan Lambright <dlambrig@redhat.com>2016-01-13 19:19:23 -0800
commitca515db012718f2d4998edf682c70ccba29924c6 (patch)
treec8f1db4983dbcad6c13b0312a16d1bfd3970e4a2 /xlators/mount
parent14f925f5262ecabb2faf8142267c37103413e189 (diff)
fuse:sent at least one lookup before actual fop
Fuse shoud sent atleast one lookup for an inode/gfid populated via readdirp before actual fop to populate inode ctx for xlators Change-Id: I5c02ed73f892924c9e404d91cbe0633a275accbd BUG: 1236032 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/11892 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/mount')
-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 */