summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/mount3.c
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-04-02 15:51:30 +0200
committerVijay Bellur <vbellur@redhat.com>2015-04-04 10:48:35 -0700
commit28397cae4102ac3f08576ebaf071ad92683097e8 (patch)
tree4c8be92299a951c8a28e1dc85bf2671f60da6e08 /xlators/nfs/server/src/mount3.c
parent0aebfaa349c7c68c2d59531eabae5a03a748e16a (diff)
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 <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10017 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/mount3.c')
-rw-r--r--xlators/nfs/server/src/mount3.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index affd338abc5..63bb44fdcde 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -656,7 +656,7 @@ __mnt3_get_volume_id (struct mount3_state *ms, xlator_t *mntxl,
LOCK (&ms->mountlock);
list_for_each_entry (exp, &ms->exportlist, explist) {
if (exp->vol == mntxl) {
- uuid_copy (volumeid, exp->volumeid);
+ gf_uuid_copy (volumeid, exp->volumeid);
ret = 0;
goto out;
}
@@ -1028,7 +1028,7 @@ __mnt3_resolve_export_subdir_comp (mnt3_resolve_t *mres)
goto err;
/* Wipe the contents of the previous component */
- uuid_copy (gfid, mres->resolveloc.inode->gfid);
+ gf_uuid_copy (gfid, mres->resolveloc.inode->gfid);
nfs_loc_wipe (&mres->resolveloc);
ret = nfs_entry_loc_fill (mres->exp->vol->itable, gfid, nextcomp,
&mres->resolveloc, NFS_RESOLVE_CREATE);
@@ -3150,7 +3150,7 @@ mnt3_init_export_ent (struct mount3_state *ms, xlator_t *xl, char *exportpath,
* actually use it when a mount request comes in and a file handle
* needs to be built.
*/
- uuid_copy (exp->volumeid, volumeid);
+ gf_uuid_copy (exp->volumeid, volumeid);
exp->vol = xl;
/* On success we should return from here*/
@@ -3213,7 +3213,7 @@ __mnt3_init_volume (struct mount3_state *ms, dict_t *opts, xlator_t *xlator)
if ((!ms) || (!xlator) || (!opts))
return -1;
- uuid_clear (volumeid);
+ gf_uuid_clear (volumeid);
if (gf_nfs_dvm_off (nfs_state (ms->nfsx)))
goto no_dvm;
@@ -3240,7 +3240,7 @@ __mnt3_init_volume (struct mount3_state *ms, dict_t *opts, xlator_t *xlator)
}
if (optstr) {
- ret = uuid_parse (optstr, volumeid);
+ ret = gf_uuid_parse (optstr, volumeid);
if (ret < 0) {
gf_log (GF_MNT, GF_LOG_ERROR, "Failed to parse volume "
"UUID");