summaryrefslogtreecommitdiffstats
path: root/xlators/features/gfid-access/src/gfid-access.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-06-08 11:23:26 +0530
committerVijay Bellur <vbellur@redhat.com>2014-06-10 08:01:13 -0700
commit99781d55f16373e793138c7b011eea09a62075b9 (patch)
tree7a4296f51a85dc197dff9b978437a8e61101bf44 /xlators/features/gfid-access/src/gfid-access.c
parent94260c93a144b52964a27ddc9eaef869a3e8f354 (diff)
features/gfid-access: Fix inode leaks and loc path corruption
Change-Id: Ib506db28415d57b344aa90e07e74666ad2063c64 BUG: 1104919 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8009 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/gfid-access/src/gfid-access.c')
-rw-r--r--xlators/features/gfid-access/src/gfid-access.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c
index 5be60bfa913..040d530cb19 100644
--- a/xlators/features/gfid-access/src/gfid-access.c
+++ b/xlators/features/gfid-access/src/gfid-access.c
@@ -96,7 +96,6 @@ ga_newfile_parse_args (xlator_t *this, data_t *data)
blob_len -= sizeof (uint32_t);
len = strnlen (blob, blob_len);
- if (len == blob_len)
if (len == blob_len) {
gf_log (this->name, GF_LOG_ERROR,
"gfid: %s. No null byte present.",
@@ -277,7 +276,11 @@ ga_fill_tmp_loc (loc_t *loc, xlator_t *this, uuid_t gfid,
new_loc->inode = inode_new (parent->table);
loc_path (new_loc, bname);
- new_loc->name = basename (new_loc->path);
+ if (new_loc->path) {
+ new_loc->name = strrchr (new_loc->path, '/');
+ if (new_loc->name)
+ new_loc->name++;
+ }
gfid_ptr = GF_CALLOC (1, sizeof(uuid_t), gf_common_mt_uuid_t);
if (!gfid_ptr) {