summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2014-03-08 12:50:47 -0800
committerAnand Avati <avati@redhat.com>2014-03-12 10:58:15 -0700
commit61f071e15572b12d12cf9764cac6456fc2df5ff3 (patch)
tree4179dcc4750963fe6717aeac2d9eb1ad6db469e4 /xlators
parent3076f75e57b971dd07165929b3dc4d0b0e312623 (diff)
locks: fix unconditional op_ret success of entrylk
Bug introduced in recent refactoring. op_ret of entrylk() was always getting set to 0 even though second locker wouldn't have gotten a lock. This was resulting in multiple contenders to get locks granted at the same time. Change-Id: I99c187a9285fb80cc500b38f468f2ebda7048cab Signed-off-by: Anand Avati <avati@redhat.com> BUG: 849630 Reviewed-on: http://review.gluster.org/7224 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/locks/src/entrylk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c
index c176306fe4f..ea69956271f 100644
--- a/xlators/features/locks/src/entrylk.c
+++ b/xlators/features/locks/src/entrylk.c
@@ -607,6 +607,9 @@ pl_common_entrylk (call_frame_t *frame, xlator_t *this,
if (unlocked) {
list_del_init (&unlocked->client_list);
__pl_entrylk_unref (unlocked);
+ op_ret = 0;
+ } else {
+ op_errno = EINVAL;
}
__pl_entrylk_unref (reqlock);
}
@@ -624,8 +627,6 @@ pl_common_entrylk (call_frame_t *frame, xlator_t *this,
"a bug report at http://bugs.gluster.com", cmd);
goto out;
}
-
- op_ret = 0;
out:
pl_update_refkeeper (this, inode);