From 28397cae4102ac3f08576ebaf071ad92683097e8 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Thu, 2 Apr 2015 15:51:30 +0200 Subject: Avoid conflict between contrib/uuid and system uuid glusterfs relies on Linux uuid implementation, which API is incompatible with most other systems's uuid. As a result, libglusterfs has to embed contrib/uuid, which is the Linux implementation, on non Linux systems. This implementation is incompatible with systtem's built in, but the symbols have the same names. Usually this is not a problem because when we link with -lglusterfs, libc's symbols are trumped. However there is a problem when a program not linked with -lglusterfs will dlopen() glusterfs component. In such a case, libc's uuid implementation is already loaded in the calling program, and it will be used instead of libglusterfs's implementation, causing crashes. A possible workaround is to use pre-load libglusterfs in the calling program (using LD_PRELOAD on NetBSD for instance), but such a mechanism is not portable, nor is it flexible. A much better approach is to rename libglusterfs's uuid_* functions to gf_uuid_* to avoid any possible conflict. This is what this change attempts. BUG: 1206587 Change-Id: I9ccd3e13afed1c7fc18508e92c7beb0f5d49f31a Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/10017 Tested-by: Gluster Build System Reviewed-by: Niels de Vos --- xlators/cluster/afr/src/afr-self-heal-entry.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 13825e1ebad..1f3ea38ffd9 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -44,7 +44,7 @@ afr_selfheal_entry_delete (xlator_t *this, inode_t *dir, const char *name, subvol = priv->children[child]; loc.parent = inode_ref (dir); - uuid_copy (loc.pargfid, dir->gfid); + gf_uuid_copy (loc.pargfid, dir->gfid); loc.name = name; loc.inode = inode_ref (inode); @@ -97,7 +97,7 @@ afr_selfheal_recreate_entry (xlator_t *this, int dst, int source, inode_t *dir, return -ENOMEM; loc.parent = inode_ref (dir); - uuid_copy (loc.pargfid, dir->gfid); + gf_uuid_copy (loc.pargfid, dir->gfid); loc.name = name; loc.inode = inode_ref (inode); @@ -113,7 +113,7 @@ afr_selfheal_recreate_entry (xlator_t *this, int dst, int source, inode_t *dir, iatt = &replies[source].poststat; srcloc.inode = inode_ref (inode); - uuid_copy (srcloc.gfid, iatt->ia_gfid); + gf_uuid_copy (srcloc.gfid, iatt->ia_gfid); mode = st_mode_from_ia (iatt->ia_prot, iatt->ia_type); @@ -186,7 +186,7 @@ __afr_selfheal_heal_dirent (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = afr_selfheal_entry_delete (this, fd->inode, name, inode, i, replies); } else { - if (!uuid_compare (replies[i].poststat.ia_gfid, + if (!gf_uuid_compare (replies[i].poststat.ia_gfid, replies[source].poststat.ia_gfid)) continue; @@ -227,7 +227,7 @@ afr_selfheal_detect_gfid_and_type_mismatch (xlator_t *this, if (replies[i].op_ret != 0) continue; - if (uuid_compare (replies[src_idx].poststat.ia_gfid, + if (gf_uuid_compare (replies[src_idx].poststat.ia_gfid, replies[i].poststat.ia_gfid)) { gf_log (this->name, GF_LOG_ERROR, "Gfid mismatch " "detected for <%s/%s>, %s on %s and %s on %s. " @@ -680,7 +680,7 @@ afr_selfheal_data_opendir (xlator_t *this, inode_t *inode) return NULL; loc.inode = inode_ref (inode); - uuid_copy (loc.gfid, inode->gfid); + gf_uuid_copy (loc.gfid, inode->gfid); ret = syncop_opendir (this, &loc, fd); if (ret) { -- cgit