diff options
author | Venky Shankar <vshankar@redhat.com> | 2014-01-23 12:40:09 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-01-27 07:51:53 -0800 |
commit | 0c80a202d475a4abb8a5738f144739234d7557c6 (patch) | |
tree | 1ec58ccd214baf29340eb54d779ba813daec2680 /xlators | |
parent | 4e8b968de0a102b538c3436f216913686f0e07ea (diff) |
features/gfid-access: fix lookup on .gfid/<parent>/bname
In gfid translator, lookup was not handling the case when
the lookup is sent on .gfid/<parent>/bname. In this case,
we flip with fake inode of the parent with the real inode
in loc and send it downwards.
Change-Id: I639ff1dce10ffc045da419e333d455e208b6a0f0
BUG: 1057881
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/6795
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/6807
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/gfid-access/src/gfid-access.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index 7b114a1c7fe..362fdab5a74 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -765,7 +765,24 @@ ga_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) but on gfid-path */ if (!((loc->parent && __is_gfid_access_dir (loc->parent->gfid)) || __is_gfid_access_dir (loc->pargfid))) { + if (!loc->parent) goto wind; + + ret = inode_ctx_get (loc->parent, this, &value); + if (ret) + goto wind; + + inode = (inode_t *) value; + + ret = loc_copy_overload_parent (&tmp_loc, loc, inode); + if (ret) + goto err; + + STACK_WIND (frame, ga_lookup_cbk, FIRST_CHILD (this), + FIRST_CHILD (this)->fops->lookup, &tmp_loc, xdata); + + loc_wipe (&tmp_loc); + return 0; } /* make sure the 'basename' is actually a 'canonical-gfid', |