summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/afr/src/afr-lk-common.c3
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c
index e85fe6dab6..226e88c104 100644
--- a/xlators/cluster/afr/src/afr-lk-common.c
+++ b/xlators/cluster/afr/src/afr-lk-common.c
@@ -1766,6 +1766,7 @@ afr_unlock (call_frame_t *frame, xlator_t *this)
local = frame->local;
if (transaction_lk_op (local)) {
+ afr_set_lk_owner (frame, this, frame->root);
if (is_afr_lock_transaction (local))
afr_unlock_inodelk (frame, this);
else
@@ -2294,6 +2295,8 @@ afr_lk_transfer_datalock (call_frame_t *dst, call_frame_t *src,
sizeof (*src_lock->inode_locked_nodes) * child_count);
}
+ dst_lock->transaction_lk_type = src_lock->transaction_lk_type;
+ dst_lock->selfheal_lk_type = src_lock->selfheal_lk_type;
dst_lock->inodelk_lock_count = src_lock->inodelk_lock_count;
src_lock->inodelk_lock_count = 0;
}
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index c46ec6cf61..dedc0ba621 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -1214,6 +1214,11 @@ afr_internal_lock_finish (call_frame_t *frame, xlator_t *this)
priv = this->private;
local = frame->local;
+ /* Perform fops with the lk-owner from top xlator.
+ * Eg: lk-owner of posix-lk and flush should be same,
+ * flush cant clear the posix-lks without that lk-owner.
+ */
+ frame->root->lk_owner = local->transaction.main_frame->root->lk_owner;
if (__fop_changelog_needed (frame, this)) {
afr_changelog_pre_op (frame, this);
} else {