From c9b96e26a3bab09a4146b2bec57a57c69b9aa8b7 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sat, 28 Jul 2012 12:18:50 +0530 Subject: features/locks: Fix statedump code RCA: Taking blocking mutex/spin locks lead to dead locks because of the locking order in statedumps. Also we were asked to remove gf_logs if possible to avoid extra cost in signal handlers. Fix: changed blocking mutes/spin locks to their non-blocking variants. Removed gf_logs in locks xlator statedump code-path. Tests: State-dump success cases are working fine. Triggered try-lock failures by putting statedumps in a while loop. In parallel did chown of the same file in a while loop. Change-Id: I81539a62f8216f267f57bb703ef132c85bfd557d BUG: 843781 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3747 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/features/locks/src/inodelk.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'xlators/features/locks/src/inodelk.c') diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index eba85795c20..8ac039fba55 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -694,7 +694,7 @@ pl_finodelk (call_frame_t *frame, xlator_t *this, } -static int32_t +int32_t __get_inodelk_count (xlator_t *this, pl_inode_t *pl_inode) { int32_t count = 0; @@ -703,34 +703,9 @@ __get_inodelk_count (xlator_t *this, pl_inode_t *pl_inode) list_for_each_entry (dom, &pl_inode->dom_list, inode_list) { list_for_each_entry (lock, &dom->inodelk_list, list) { - - gf_log (this->name, GF_LOG_DEBUG, - " XATTR DEBUG" - " domain: %s %s (pid=%d) (lk-owner=%s) %"PRId64" - %"PRId64" " - "state = Active", - dom->domain, - lock->fl_type == F_UNLCK ? "Unlock" : "Lock", - lock->client_pid, - lkowner_utoa (&lock->owner), - lock->user_flock.l_start, - lock->user_flock.l_len); - count++; } - list_for_each_entry (lock, &dom->blocked_inodelks, blocked_locks) { - - gf_log (this->name, GF_LOG_DEBUG, - " XATTR DEBUG" - " domain: %s %s (pid=%d) (lk-owner=%s) %"PRId64" - %"PRId64" " - "state = Blocked", - dom->domain, - lock->fl_type == F_UNLCK ? "Unlock" : "Lock", - lock->client_pid, - lkowner_utoa (&lock->owner), - lock->user_flock.l_start, - lock->user_flock.l_len); - count++; } -- cgit