summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2009-10-13 06:22:37 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-13 05:46:43 -0700
commitb20cee457232a88517af44ae4505361dd3a4de15 (patch)
treec0376dd4aa4a329b73dea2a1f14d0df8ea95f852
parentbabdbcbb6a434d65b0fdd9df708e94bea13cf05d (diff)
afr transaction prevent spurious unlocks
mark a subvol with held lock only if op_ret == 0 Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 112 (parallel deletion of files mounted by different clients on the same back-end hangs and/or does not completely delete) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=112
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 5f2696b64..40a4bb26a 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -919,8 +919,10 @@ afr_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
(local->op_errno == ENOSYS)) {
afr_unlock (frame, this);
} else {
- local->transaction.locked_nodes[child_index] = 1;
- local->transaction.lock_count++;
+ if (op_ret == 0) {
+ local->transaction.locked_nodes[child_index] = 1;
+ local->transaction.lock_count++;
+ }
afr_lock_rec (frame, this, child_index + 1);
}