From 61f071e15572b12d12cf9764cac6456fc2df5ff3 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. Change-Id: I99c187a9285fb80cc500b38f468f2ebda7048cab Signed-off-by: Anand Avati BUG: 849630 Reviewed-on: http://review.gluster.org/7224 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY --- 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 c176306fe..ea6995627 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