Merge branch 'upstream-jeff' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu...
[cascardo/linux.git] / fs / gfs2 / glock.c
index 931368a..a37efe4 100644 (file)
@@ -716,12 +716,8 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state,
                gl->gl_demote_time = jiffies;
                if (remote && gl->gl_ops->go_type == LM_TYPE_IOPEN &&
                    gl->gl_object) {
-                       struct inode *inode = igrab(gl->gl_object);
+                       gfs2_glock_schedule_for_reclaim(gl);
                        spin_unlock(&gl->gl_spin);
-                       if (inode) {
-                               d_prune_aliases(inode);
-                               iput(inode);
-                       }
                        return;
                }
        } else if (gl->gl_demote_state != LM_ST_UNLOCKED &&
@@ -1106,24 +1102,31 @@ static void add_to_queue(struct gfs2_holder *gh)
        if (test_and_set_bit(HIF_WAIT, &gh->gh_iflags))
                BUG();
 
-       existing = find_holder_by_owner(&gl->gl_holders, gh->gh_owner_pid);
-       if (existing) {
-               print_symbol(KERN_WARNING "original: %s\n", existing->gh_ip);
-               printk(KERN_INFO "pid : %d\n", existing->gh_owner_pid);
-               printk(KERN_INFO "lock type : %d lock state : %d\n",
-                               existing->gh_gl->gl_name.ln_type, existing->gh_gl->gl_state);
-               print_symbol(KERN_WARNING "new: %s\n", gh->gh_ip);
-               printk(KERN_INFO "pid : %d\n", gh->gh_owner_pid);
-               printk(KERN_INFO "lock type : %d lock state : %d\n",
-                               gl->gl_name.ln_type, gl->gl_state);
-               BUG();
-       }
-
-       existing = find_holder_by_owner(&gl->gl_waiters3, gh->gh_owner_pid);
-       if (existing) {
-               print_symbol(KERN_WARNING "original: %s\n", existing->gh_ip);
-               print_symbol(KERN_WARNING "new: %s\n", gh->gh_ip);
-               BUG();
+       if (!(gh->gh_flags & GL_FLOCK)) {
+               existing = find_holder_by_owner(&gl->gl_holders, 
+                                               gh->gh_owner_pid);
+               if (existing) {
+                       print_symbol(KERN_WARNING "original: %s\n", 
+                                    existing->gh_ip);
+                       printk(KERN_INFO "pid : %d\n", existing->gh_owner_pid);
+                       printk(KERN_INFO "lock type : %d lock state : %d\n",
+                              existing->gh_gl->gl_name.ln_type, 
+                              existing->gh_gl->gl_state);
+                       print_symbol(KERN_WARNING "new: %s\n", gh->gh_ip);
+                       printk(KERN_INFO "pid : %d\n", gh->gh_owner_pid);
+                       printk(KERN_INFO "lock type : %d lock state : %d\n",
+                              gl->gl_name.ln_type, gl->gl_state);
+                       BUG();
+               }
+               
+               existing = find_holder_by_owner(&gl->gl_waiters3, 
+                                               gh->gh_owner_pid);
+               if (existing) {
+                       print_symbol(KERN_WARNING "original: %s\n", 
+                                    existing->gh_ip);
+                       print_symbol(KERN_WARNING "new: %s\n", gh->gh_ip);
+                       BUG();
+               }
        }
 
        if (gh->gh_flags & LM_FLAG_PRIORITY)