Red Hat Bugzilla – Bug 1461808
glfs_get_volumeid() returns junk strings
Last modified: 2017-06-20 09:44:22 EDT
My apologies, missed in the first code walktrough. So, the glfs_get_volumeid gives the UUID in uuid_t format i.e. as opaque data of 16 bytes and is non printable. Hence, the printf on uuid is wrong usage. The API documentation in glfs.h clearly states that the uuid returned is opaque.
Hence this is not a bug. Please confirm the same.
Also for your use case, you can store the uuid as opaque and compare the uuids using memcmp()
I stronly recommend to not use an opaque value if you care about calling glfs_get_volumeid(). Store it in a uuid_t, and don't use memcmp() to compare but use uuid_compare() instead :)
We can not change glfs_get_volumeid() because there are other users of this function (at least NFS-Ganesha).
This should probably be closed as NOTABUG, please do so while replying with your acceptance.
Also, Prasanna, what is your use-case for calling glfs_get_volumeid() in the first place? Normal users should really not need to know the volume-id...
So hence we can close this bug and work as a part of some other bug https://bugzilla.redhat.com/show_bug.cgi?id=1459850 may be?