cluster/dht : Fix coverity issue

To check if the gfid is null or not
we should use function gf_uuid_is_null

CID: 1382364
https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86243257&defectInstanceId=26374360&mergedDefectId=1382364

Change-Id: I81944b823c9ee6e6dcc9695f64f7e5966e0d7030
updates: bz#789278
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
This commit is contained in:
Ashish Pandey 2018-10-10 13:46:22 +05:30 committed by Amar Tumballi
parent 27d3d481bd
commit 46b970f64a

View File

@ -491,14 +491,14 @@ dht_order_rename_lock(call_frame_t *frame, loc_t **loc, xlator_t **subvol)
if (ret == 0) {
/* hashed subvols are the same for src and dst */
/* Entrylks need to be ordered*/
if (local->loc.pargfid)
if (!gf_uuid_is_null(local->loc.pargfid))
uuid_utoa_r(local->loc.pargfid, src);
else if (local->loc.parent)
uuid_utoa_r(local->loc.parent->gfid, src);
strcat(src, local->loc.name);
if (local->loc2.pargfid)
if (!gf_uuid_is_null(local->loc2.pargfid))
uuid_utoa_r(local->loc2.pargfid, dst);
else if (local->loc2.parent)
uuid_utoa_r(local->loc2.parent->gfid, dst);