diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-05-04 00:29:40 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-05-03 12:22:09 -0700 |
commit | b8cfc761bd7a664a4ed73999e898973c9718ecee (patch) | |
tree | a2ac7ea6f1ed7e985d500f08f323c28b82037c4c /xlators/cluster/afr | |
parent | 9b3def01e4b6c7c3e6899e4ad52ee64440285f54 (diff) |
cluster/afr: Fix race in nonblocking entrylk
Change-Id: I6d96c1aed4bf08b90b6918e3694c688eccdc2445
BUG: 818578
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3270
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r-- | xlators/cluster/afr/src/afr-lk-common.c | 12 |
1 files changed, 6 insertions, 6 deletions
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"); |