diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-08-12 14:30:27 +0530 |
---|---|---|
committer | Dan Lambright <dlambrig@redhat.com> | 2016-02-22 06:37:20 -0800 |
commit | ebe15f0d4371fa957d1342dd125443898cb14376 (patch) | |
tree | 2812dfec4be285a5da08e89595ca6ea2793ce23b /xlators/mount | |
parent | c2462200ac3c3d49992561f2c9dd0fc55d1300c1 (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.
Back port of>
>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>
Change-Id: Iab5d9c7939771a1644fce4f6fe2520ed19455a37
BUG: 1306131
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/13415
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/mount')
-rw-r--r-- | xlators/mount/fuse/src/fuse-resolve.c | 20 |
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 46a1d711246..04f4e719ae1 100644 --- a/xlators/mount/fuse/src/fuse-resolve.c +++ b/xlators/mount/fuse/src/fuse-resolve.c @@ -93,8 +93,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); @@ -113,7 +117,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; @@ -160,6 +165,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; @@ -241,6 +253,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 */ |