From: Mark Fasheh <mark.fasheh@oracle.com>

journal_create() is called under down_write(s_umount) on the mount path.  But
it calls fsync_bdev(), which wants down_write(s_umount).

Change journal_create() to run sync_blockdev() instead.  Just to write out
the new journal's blocks.



 25-akpm/fs/jbd/journal.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/jbd/journal.c~journal_create-deadlock-fix fs/jbd/journal.c
--- 25/fs/jbd/journal.c~journal_create-deadlock-fix	Mon Jun  2 14:34:37 2003
+++ 25-akpm/fs/jbd/journal.c	Mon Jun  2 14:34:37 2003
@@ -916,7 +916,7 @@ int journal_create(journal_t *journal)
 		__brelse(bh);
 	}
 
-	fsync_bdev(journal->j_dev);
+	sync_blockdev(journal->j_dev);
 	jbd_debug(1, "JBD: journal cleared.\n");
 
 	/* OK, fill in the initial static fields in the new superblock */

_