summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-04-23 19:58:41 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-07 00:46:50 -0700
commitc5d9ac3477d295b5e97166ac655a52463a0d1fb8 (patch)
treec061c9bc4d12ad4ae07317d2490b18102b2852f3 /xlators/cluster/afr
parent0caffe52b8db6670dfa2b1c825477ede7ba304c6 (diff)
cluster/afr: Perform Flush with lk-owner given by parent xlator.
Lk-owner of posix-lk and flush should be same, flush can't clear posix-lks without that lk-owner. Change-Id: If775abb5741a0beb00c419b54d023fbd429e3cb7 BUG: 810502 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3221 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr')
-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 e85fe6dab67..226e88c1049 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 c46ec6cf611..dedc0ba6212 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 {