diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2012-11-21 14:35:10 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-11-21 12:03:37 -0800 |
commit | 2e40e0f42807f23d447d7fae67c1e2f834904c53 (patch) | |
tree | 7c535cd6a80e650993e03563bccdaeb802994e0b | |
parent | 79eb7c62e27d01d14b3053f9ecd14d6b964bac76 (diff) |
cluster/afr: check transaction type for eager-lock after it is set
Problem:
Eager locking lk-owner decision is taken before transaction
type is set. Default transaction type is DATA so all transactions
are treated as DATA transactions at the time of eager-locking
decision.
Fix:
Move the code that takes lk-owner decision after the transaction
type is set.
Test:
Checked that the transaction type is set properly in gdb at
the time of the lk-owner decision.
Change-Id: I7607c7ff4f88c7ced5416a1cddb6586cf45d88f9
BUG: 861335
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4220
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r-- | xlators/cluster/afr/src/afr-transaction.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 265d93b6189..32fb8d9a494 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -1457,12 +1457,6 @@ afr_transaction (call_frame_t *frame, xlator_t *this, afr_transaction_type type) local = frame->local; priv = this->private; - if (local->fd && priv->eager_lock && - local->transaction.type == AFR_DATA_TRANSACTION) - afr_set_lk_owner (frame, this, local->fd); - else - afr_set_lk_owner (frame, this, frame->root); - ret = afr_transaction_local_init (local, this); if (ret < 0) { goto out; @@ -1471,6 +1465,12 @@ afr_transaction (call_frame_t *frame, xlator_t *this, afr_transaction_type type) local->transaction.resume = afr_transaction_resume; local->transaction.type = type; + if (local->fd && priv->eager_lock && + local->transaction.type == AFR_DATA_TRANSACTION) + afr_set_lk_owner (frame, this, local->fd); + else + afr_set_lk_owner (frame, this, frame->root); + if (_does_transaction_conflict_with_delayed_post_op (frame) && local->loc.inode) { fd = fd_lookup (local->loc.inode, frame->root->pid); |