summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2018-07-03 20:38:23 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2018-07-04 14:38:37 +0000
commitc6f93e422855f656d3a86461a8458f37ad0103eb (patch)
treecd35619ddf7c617294bad9487286559874a29d22 /xlators
parentc80075466ddbf25766dbf805cd5161c736190b3e (diff)
cluster/afr: Make sure lk-owner is assigned at the time of lock
Problem: In the new eager-lock implementation lk-owner is assigned after the 'local' is added to the eager-lock list, so there exists a possibility of lock being sent even before lk-owner is assigned. Fix: Make sure to assign lk-owner before adding local to eager-lock list fixes bz#1597805 Change-Id: I26d1b7bcf3e8b22531f1dc0b952cae2d92889ef2 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index bfea096cf3b..61abf4aa090 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -2327,6 +2327,7 @@ __afr_eager_lock_handle (afr_local_t *local, gf_boolean_t *take_lock,
if (local->fd && !afr_are_multiple_fds_opened (local, this)) {
local->transaction.eager_lock_on = _gf_true;
+ afr_set_lk_owner (local->transaction.frame, this, local->inode);
}
lock = &local->inode_ctx->lock[local->transaction.type];
@@ -2430,8 +2431,6 @@ lock_phase:
if (!local->transaction.eager_lock_on) {
afr_set_lk_owner (local->transaction.frame, this,
local->transaction.frame->root);
- } else {
- afr_set_lk_owner (local->transaction.frame, this, local->inode);
}