From e16f05a6d1f756f16e363d93f432f950901cf777 Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Fri, 30 Oct 2009 01:45:20 +0000 Subject: Fix logic while granting blocked entrylks, which could run into an infinite loop. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Anand V. Avati BUG: 222 (Enhance Internal locks to support multilple domains and rewrite inodelks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=222 --- xlators/features/locks/src/entrylk.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c index 3b96646edcb..e96097cc1f8 100644 --- a/xlators/features/locks/src/entrylk.c +++ b/xlators/features/locks/src/entrylk.c @@ -431,15 +431,16 @@ __grant_blocked_entry_locks (xlator_t *this, pl_inode_t *pl_inode, pl_entry_lock_t *bl = NULL; pl_entry_lock_t *tmp = NULL; - list_for_each_entry_safe (bl, tmp, &dom->blocked_entrylks, - blocked_locks) { + struct list_head blocked_list; - if (__lock_grantable (dom, bl->basename, bl->type)) - continue; + INIT_LIST_HEAD (&blocked_list); + list_splice_init (&dom->blocked_entrylks, &blocked_list); + + list_for_each_entry_safe (bl, tmp, &blocked_list, + blocked_locks) { list_del_init (&bl->blocked_locks); - /* TODO: error checking */ gf_log ("locks", GF_LOG_TRACE, "Trying to unblock: {pinode=%p, basename=%s}", -- cgit