diff options
author | Raghavendra G <raghavendra@gluster.com> | 2012-03-14 09:58:05 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-03-14 02:56:12 -0700 |
commit | 84da099ed321621928f11fe9cd164a4b0cfe1883 (patch) | |
tree | 27053f15a05637c5e24dde87d8fa9ab15aee197b | |
parent | a476aba5b0368c3bc649db319ee748ae410144d9 (diff) |
features/marker: Nameless lookup related fixes
while filling a loc structure, marker should not error out if loc->name
is NULL or loc->path is just a gfid.
Change-Id: Ie3a9cffde2d17da0377f1e41de93b099a9133abe
BUG: 801364
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/2938
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r-- | xlators/features/marker/src/marker.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index e8bbd9d941f..e92b27d06c4 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -65,23 +65,25 @@ marker_loc_fill (loc_t *loc, inode_t *inode, inode_t *parent, char *path) if (inode) { loc->inode = inode_ref (inode); - uuid_copy (loc->gfid, loc->inode->gfid); + if (uuid_is_null (loc->gfid)) { + uuid_copy (loc->gfid, loc->inode->gfid); + } } if (parent) loc->parent = inode_ref (parent); - loc->path = gf_strdup (path); - if (!loc->path) { - gf_log ("loc fill", GF_LOG_ERROR, "strdup failed"); - goto loc_wipe; - } + if (path) { + loc->path = gf_strdup (path); + if (!loc->path) { + gf_log ("loc fill", GF_LOG_ERROR, "strdup failed"); + goto loc_wipe; + } - loc->name = strrchr (loc->path, '/'); - if (loc->name) - loc->name++; - else - goto loc_wipe; + loc->name = strrchr (loc->path, '/'); + if (loc->name) + loc->name++; + } ret = 0; loc_wipe: |