[JFFS2] Prevent deadlock when flushing write buffer
authorArtem B. Bityuckiy <dedekind@infradead.org>
Sun, 20 Mar 2005 21:43:26 +0000 (21:43 +0000)
committerThomas Gleixner <tglx@mtd.linutronix.de>
Mon, 23 May 2005 11:03:04 +0000 (13:03 +0200)
Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/jffs2/gc.c

index 44fa7379098f3ded8958f2c158d67672cead4104..694bc90ad77997a72b0c0b1bdde39d734219fa42 100644 (file)
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: gc.c,v 1.146 2005/03/20 17:45:25 dedekind Exp $
+ * $Id: gc.c,v 1.147 2005/03/20 21:43:22 dedekind Exp $
  *
  */
 
@@ -83,7 +83,9 @@ again:
        } else if (!list_empty(&c->erasable_pending_wbuf_list)) {
                /* There are blocks are wating for the wbuf sync */
                D1(printk(KERN_DEBUG "Synching wbuf in order to reuse erasable_pending_wbuf_list blocks\n"));
+               spin_unlock(&c->erase_completion_lock);
                jffs2_flush_wbuf_pad(c);
+               spin_lock(&c->erase_completion_lock);
                goto again;
        } else {
                /* Eep. All were empty */