diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2016-04-26 16:05:04 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-04-28 13:46:06 -0700 |
commit | 40e96c17647b281264783520f8fbdd9056332b4c (patch) | |
tree | ee04e4ed4b2645a95b7e4dac1ca842b26d69c733 /xlators | |
parent | 04d57237099fefa3a92a0cca4c65e43f39c13379 (diff) |
protocol/client: Use loc->pargfid if loc->parent(->gfid) is not filled
Change-Id: Id73bf635ca94dcf7518b33e529ffca07daeeb1f4
BUG: 1269461
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/14078
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/protocol/client/src/client-rpc-fops.c | 14 |
1 files changed, 6 insertions, 8 deletions
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); |