From 18ad6f2dc7b8254ef718de6311f7344b28e99797 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sat, 8 Mar 2014 12:50:47 -0800 Subject: 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. BUG: 849630 Change-Id: I130d521407afee15de59f270b59687d41982fb29 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/7232 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/locks/src/entrylk.c | 5 +++-- 1 file 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); -- cgit