JFS: Fix race waking up jfsIO kernel thread
[powerpc.git] / fs / jfs / jfs_logmgr.c
index ff7f1be..16c6268 100644 (file)
@@ -2354,12 +2354,13 @@ int jfsIOWait(void *arg)
                        lbmStartIO(bp);
                        spin_lock_irq(&log_redrive_lock);
                }
-               spin_unlock_irq(&log_redrive_lock);
 
                if (freezing(current)) {
+                       spin_unlock_irq(&log_redrive_lock);
                        refrigerator();
                } else {
                        set_current_state(TASK_INTERRUPTIBLE);
+                       spin_unlock_irq(&log_redrive_lock);
                        schedule();
                        __set_current_state(TASK_RUNNING);
                }