From b8cfc761bd7a664a4ed73999e898973c9718ecee Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 4 May 2012 00:29:40 +0530 Subject: cluster/afr: Fix race in nonblocking entrylk Change-Id: I6d96c1aed4bf08b90b6918e3694c688eccdc2445 BUG: 818578 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3270 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/cluster/afr/src/afr-lk-common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xlators/cluster/afr/src/afr-lk-common.c') diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index dfdde2975..e85fe6dab 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -1180,12 +1180,6 @@ afr_nonblocking_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, AFR_LOCK_OP, NULL, op_ret, op_errno, (long) cookie); - LOCK (&frame->lock); - { - call_count = --int_lock->lk_call_count; - } - UNLOCK (&frame->lock); - if (op_ret < 0 ) { if (op_errno == ENOSYS) { /* return ENOTSUP */ @@ -1203,6 +1197,12 @@ afr_nonblocking_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int_lock->entrylk_lock_count++; } + LOCK (&frame->lock); + { + call_count = --int_lock->lk_call_count; + } + UNLOCK (&frame->lock); + if (call_count == 0) { gf_log (this->name, GF_LOG_TRACE, "Last locking reply received"); -- cgit