summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2015-09-16 16:35:19 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-10-13 04:26:35 -0700
commit1a1b00fcd0ec199d19652d8fceb9465cc4edf189 (patch)
tree8bd81d67aec1e763e4ee65710b4bdd6fa83cddf9 /xlators/protocol
parent130190a3e1f2226883284aedbd63a9505fd0b702 (diff)
protocol/client: give preference to loc->gfid over inode->gfid
Backport of review.gluster.org/#/c/12233/ 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: 1266836 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/12234 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index 2c0b477f2c8..27b364116e0 100644
--- a/xlators/protocol/client/src/client-rpc-fops.c
+++ b/xlators/protocol/client/src/client-rpc-fops.c
@@ -5541,10 +5541,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)),
@@ -5704,10 +5704,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)),