kernel_optimize_test/fs/ext4
Eric Sandeen c1bb05a657 ext4: avoid deadlock on sync-mounted FS w/o journal
Processes hang forever on a sync-mounted ext2 file system that
is mounted with the ext4 module (default in Fedora 16).

I can reproduce this reliably by mounting an ext2 partition with
"-o sync" and opening a new file an that partition with vim. vim
will hang in "D" state forever.  The same happens on ext4 without
a journal.

I am attaching a small patch here that solves this issue for me.
In the sync mounted case without a journal,
ext4_handle_dirty_metadata() may call sync_dirty_buffer(), which
can't be called with buffer lock held.

Also move mb_cache_entry_release inside lock to avoid race
fixed previously by 8a2bfdcb ext[34]: EA block reference count racing fix
Note too that ext2 fixed this same problem in 2006 with
b2f49033 [PATCH] fix deadlock in ext2

Signed-off-by: Martin.Wilck@ts.fujitsu.com
[sandeen@redhat.com: move mb_cache_entry_release before unlock, edit commit msg]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-02-20 23:06:18 -05:00
..
acl.c
acl.h
balloc.c ext4: fix balloc.c printk-format-warning 2012-02-20 17:57:24 -05:00
bitmap.c
block_validity.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
dir.c ext4: remove an unneeded NULL check in __ext4_check_dir_entry() 2012-02-20 17:53:05 -05:00
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h ext4: expand commit callback and 2012-02-20 17:53:02 -05:00
ext4.h ext4: fix race between unwritten extent conversion and truncate 2012-02-20 17:59:24 -05:00
extents.c Merge branch 'for_linus' into for_linus_merged 2012-01-10 11:54:07 -05:00
file.c
fsync.c
hash.c
ialloc.c ext4: fix race when setting bitmap_uptodate flag 2012-02-20 17:52:46 -05:00
indirect.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
inode.c ext4: fix race between unwritten extent conversion and truncate 2012-02-20 17:59:24 -05:00
ioctl.c Merge branch 'for_linus' into for_linus_merged 2012-01-10 11:54:07 -05:00
Kconfig
Makefile
mballoc.c ext4: remove EXT4_MB_{BITMAP,BUDDY} macros 2012-02-20 17:54:06 -05:00
mballoc.h ext4: remove EXT4_MB_{BITMAP,BUDDY} macros 2012-02-20 17:54:06 -05:00
migrate.c ext4: using PTR_ERR() on the wrong variable in ext4_ext_migrate() 2012-02-20 17:53:06 -05:00
mmp.c
move_extent.c
namei.c ext[34]: avoid i_nlink warnings triggered by drop_nlink/inc_nlink kludge in symlink() 2012-01-08 20:19:30 -05:00
page-io.c ext4: fix race between unwritten extent conversion and truncate 2012-02-20 17:59:24 -05:00
resize.c ext4: fix resize when resizing within single group 2012-02-20 23:02:06 -05:00
super.c ext4: remove the resize mount option 2012-02-20 17:53:04 -05:00
symlink.c
truncate.h
xattr_security.c Merge branch 'for_linus' into for_linus_merged 2012-01-10 11:54:07 -05:00
xattr_trusted.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
xattr_user.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
xattr.c ext4: avoid deadlock on sync-mounted FS w/o journal 2012-02-20 23:06:18 -05:00
xattr.h