From 40e96c17647b281264783520f8fbdd9056332b4c Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 26 Apr 2016 16:05:04 +0530 Subject: protocol/client: Use loc->pargfid if loc->parent(->gfid) is not filled Change-Id: Id73bf635ca94dcf7518b33e529ffca07daeeb1f4 BUG: 1269461 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/14078 Reviewed-by: Pranith Kumar Karampuri NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System --- xlators/protocol/client/src/client-rpc-fops.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'xlators/protocol') diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index d56c554360a..e1fee8c7c66 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -3326,17 +3326,15 @@ client3_3_lookup (call_frame_t *frame, xlator_t *this, loc_copy (&local->loc, args->loc); loc_path (&local->loc, NULL); - if (args->loc->parent) { - if (!gf_uuid_is_null (args->loc->parent->gfid)) + if ((args->loc->parent) && (!gf_uuid_is_null (args->loc->parent->gfid))) memcpy (req.pargfid, args->loc->parent->gfid, 16); else memcpy (req.pargfid, args->loc->pargfid, 16); - } else { - if (!gf_uuid_is_null (args->loc->inode->gfid)) - memcpy (req.gfid, args->loc->inode->gfid, 16); - else - memcpy (req.gfid, args->loc->gfid, 16); - } + + if ((args->loc->inode) && (!gf_uuid_is_null (args->loc->inode->gfid))) + memcpy (req.gfid, args->loc->inode->gfid, 16); + else + memcpy (req.gfid, args->loc->gfid, 16); if (args->xdata) { content = dict_get (args->xdata, GF_CONTENT_KEY); -- cgit