summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2009-10-30 01:45:20 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-30 01:21:41 -0700
commite16f05a6d1f756f16e363d93f432f950901cf777 (patch)
treed2178587597b91c50eb381cdd312d6ef2faa728a
parentc68255daa11937b7f91de11f8d4361d798aa8cbc (diff)
Fix logic while granting blocked entrylks, which could run into an infinite loop.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> 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
-rw-r--r--xlators/features/locks/src/entrylk.c11
1 files changed, 6 insertions, 5 deletions
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}",