From 79c5a715f9bab49f48876ab4f4bc79d211c0d7f1 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 16 Sep 2015 16:35:19 +0530 Subject: protocol/client: give preference to loc->gfid over inode->gfid There are xlators which perform fops even before inode gets linked. Because of this loc.gfid is preferred at the time of inodelk/entrylk but by the time unlock can happen, inode could be linked with a different gfid than the one in loc.gfid (because of the way dht was giving preference) Due to this unlock goes on a different inode than the one we sent inodelk on, which leads to hang. Credits to Pranith for the fix. Change-Id: I7d162d44852ba876f35aa1bb83e4afdb184d85b9 BUG: 1266834 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/12233 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/protocol/client/src/client-rpc-fops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xlators') diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index 15ffeb9aade..0d80443c93a 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -5536,10 +5536,10 @@ client3_3_inodelk (call_frame_t *frame, xlator_t *this, if (!(args->loc && args->loc->inode)) goto unwind; - if (!gf_uuid_is_null (args->loc->inode->gfid)) - memcpy (req.gfid, args->loc->inode->gfid, 16); + if (!gf_uuid_is_null (args->loc->gfid)) + memcpy (req.gfid, args->loc->gfid, 16); else - memcpy (req.gfid, args->loc->gfid, 16); + memcpy (req.gfid, args->loc->inode->gfid, 16); GF_ASSERT_AND_GOTO_WITH_ERROR (this->name, !gf_uuid_is_null (*((uuid_t*)req.gfid)), @@ -5699,10 +5699,10 @@ client3_3_entrylk (call_frame_t *frame, xlator_t *this, if (!(args->loc && args->loc->inode)) goto unwind; - if (!gf_uuid_is_null (args->loc->inode->gfid)) - memcpy (req.gfid, args->loc->inode->gfid, 16); + if (!gf_uuid_is_null (args->loc->gfid)) + memcpy (req.gfid, args->loc->gfid, 16); else - memcpy (req.gfid, args->loc->gfid, 16); + memcpy (req.gfid, args->loc->inode->gfid, 16); GF_ASSERT_AND_GOTO_WITH_ERROR (this->name, !gf_uuid_is_null (*((uuid_t*)req.gfid)), -- cgit