From b43038ee84839fa6b0e6aee037f7d952d8f52b6d Mon Sep 17 00:00:00 2001 From: Pranith K Date: Sat, 16 Jul 2011 08:19:47 +0000 Subject: cluster/afr: Don't depend on fuse lk_owner for inodelks Signed-off-by: Pranith Kumar K Signed-off-by: Anand Avati BUG: 3182 (Afr self-heal should happen with out big lock) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3182 --- xlators/cluster/afr/src/afr-lk-common.c | 10 ++++------ xlators/cluster/afr/src/afr-self-heal-common.c | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index 4b1aa6c7c..fc54682d1 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -59,12 +59,10 @@ afr_set_lock_number (call_frame_t *frame, xlator_t *this) void afr_set_lk_owner (call_frame_t *frame, xlator_t *this) { - if (!frame->root->lk_owner) { - gf_log (this->name, GF_LOG_TRACE, - "Setting lk-owner=%llu", - (unsigned long long) (unsigned long)frame->root); - frame->root->lk_owner = (uint64_t) (unsigned long)frame->root; - } + gf_log (this->name, GF_LOG_TRACE, + "Setting lk-owner=%llu", + (unsigned long long) (unsigned long)frame->root); + frame->root->lk_owner = (uint64_t) (unsigned long)frame->root; } static int diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index d76e6c8de..21134d9f7 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -2027,8 +2027,6 @@ afr_self_heal (call_frame_t *frame, xlator_t *this, inode_t *inode) GF_ASSERT (local->loc.path); - afr_set_lk_owner (frame, this); - if (local->self_heal.background) { LOCK (&priv->lock); { @@ -2052,6 +2050,8 @@ afr_self_heal (call_frame_t *frame, xlator_t *this, inode_t *inode) local->self_heal.need_entry_self_heal); sh_frame = copy_frame (frame); + afr_set_lk_owner (sh_frame, this); + sh_local = afr_local_copy (local, this); sh_frame->local = sh_local; sh = &sh_local->self_heal; -- cgit