From c5d9ac3477d295b5e97166ac655a52463a0d1fb8 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 23 Apr 2012 19:58:41 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/3221 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-lk-common.c | 3 +++ xlators/cluster/afr/src/afr-transaction.c | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index e85fe6dab..226e88c10 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 c46ec6cf6..dedc0ba62 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 { -- cgit