summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2012-10-11 14:14:37 +0530
committerVijay Bellur <vbellur@redhat.com>2012-12-12 00:21:09 -0500
commit6ae820dc4c79f34a5c381b752a80c4b0169b60bb (patch)
tree0158a6bb1de036b6ff315e1e1cd218c61992a91c
parent9c8e941d49eadb32808d443bd2231826451d9a6d (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: Icb1464bc572cf0be73bdd4d5803a2326b5d22655 BUG: 865321 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: https://code.engineering.redhat.com/gerrit/85 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: https://code.engineering.redhat.com/gerrit/1879
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c12
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 6604b75566e..33b87780dda 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -1440,17 +1440,17 @@ 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);
-
afr_transaction_local_init (local, this);
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);