kernel-ark/fs/ext4
Theodore Ts'o b56ff9d397 ext4: Don't call sb_issue_discard() in ext4_free_blocks()
Commit 5c521830cf (ext4: Support discard requests when running in
no-journal mode) attempts to add sb_issue_discard() for data blocks
(in data=writeback mode) and in no-journal mode.  Unfortunately, this
no longer works, because in commit dd3932eddf (block: remove
BLKDEV_IFL_WAIT), sb_issue_discard() only presents a synchronous
interface, and there are times when we call ext4_free_blocks() when we
are are holding a spinlock, or are otherwise in an atomic context.

For now, I've removed the call to sb_issue_discard() to prevent a
deadlock or (if spinlock debugging is enabled) failures like this:

BUG: scheduling while atomic: rc.sysinit/1376/0x00000002
Pid: 1376, comm: rc.sysinit Not tainted 2.6.36-ARCH #1
Call Trace:
[<ffffffff810397ce>] __schedule_bug+0x5e/0x70
[<ffffffff81403110>] schedule+0x950/0xa70
[<ffffffff81060bad>] ? insert_work+0x7d/0x90
[<ffffffff81060fbd>] ? queue_work_on+0x1d/0x30
[<ffffffff81061127>] ? queue_work+0x37/0x60
[<ffffffff8140377d>] schedule_timeout+0x21d/0x360
[<ffffffff812031c3>] ? generic_make_request+0x2c3/0x540
[<ffffffff81402680>] wait_for_common+0xc0/0x150
[<ffffffff81041490>] ? default_wake_function+0x0/0x10
[<ffffffff812034bc>] ? submit_bio+0x7c/0x100
[<ffffffff810680a0>] ? wake_bit_function+0x0/0x40
[<ffffffff814027b8>] wait_for_completion+0x18/0x20
[<ffffffff8120a969>] blkdev_issue_discard+0x1b9/0x210
[<ffffffff811ba03e>] ext4_free_blocks+0x68e/0xb60
[<ffffffff811b1650>] ? __ext4_handle_dirty_metadata+0x110/0x120
[<ffffffff811b098c>] ext4_ext_truncate+0x8cc/0xa70
[<ffffffff810d713e>] ? pagevec_lookup+0x1e/0x30
[<ffffffff81191618>] ext4_truncate+0x178/0x5d0
[<ffffffff810eacbb>] ? unmap_mapping_range+0xab/0x280
[<ffffffff810d8976>] vmtruncate+0x56/0x70
[<ffffffff811925cb>] ext4_setattr+0x14b/0x460
[<ffffffff811319e4>] notify_change+0x194/0x380
[<ffffffff81117f80>] do_truncate+0x60/0x90
[<ffffffff811e08fa>] ? security_inode_permission+0x1a/0x20
[<ffffffff811eaec1>] ? tomoyo_path_truncate+0x11/0x20
[<ffffffff81127539>] do_last+0x5d9/0x770
[<ffffffff811278bd>] do_filp_open+0x1ed/0x680
[<ffffffff8140644f>] ? page_fault+0x1f/0x30
[<ffffffff81132bfc>] ? alloc_fd+0xec/0x140
[<ffffffff81118db1>] do_sys_open+0x61/0x120
[<ffffffff81118e8b>] sys_open+0x1b/0x20
[<ffffffff81002e6b>] system_call_fastpath+0x16/0x1b

https://bugzilla.kernel.org/show_bug.cgi?id=22302

Reported-by: Mathias Burén <mathias.buren@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: jiayingz@google.com
2010-11-08 13:49:33 -05:00
..
acl.c ext4: update ctime when changing the file's permission by setfacl 2010-06-15 12:19:59 -04:00
acl.h
balloc.c ext4: rename mark_bitmap_end() to ext4_mark_bitmap_end() 2010-10-27 21:30:15 -04:00
bitmap.c
block_validity.c ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*() 2010-10-27 21:30:14 -04:00
dir.c ext4: improve llseek error handling for overly large seek offsets 2010-10-27 21:30:06 -04:00
ext4_extents.h ext4: rename {ext,idx}_pblock and inline small extent functions 2010-10-27 21:30:14 -04:00
ext4_jbd2.c ext4: Pass line numbers to ext4_error() and friends 2010-07-27 11:56:40 -04:00
ext4_jbd2.h ext4: Pass line numbers to ext4_error() and friends 2010-07-27 11:56:40 -04:00
ext4.h ext4: fix potential race when freeing ext4_io_page structures 2010-11-08 13:45:33 -05:00
extents.c Merge branch 'next' into upstream-merge 2010-10-27 23:44:47 -04:00
file.c ext4: improve llseek error handling for overly large seek offsets 2010-10-27 21:30:06 -04:00
fsync.c Merge branch 'next' into upstream-merge 2010-10-27 23:44:47 -04:00
hash.c
ialloc.c Merge branch 'next' into upstream-merge 2010-10-27 23:44:47 -04:00
inode.c ext4: BUG_ON fix: check if page has buffers before calling page_buffers() 2010-10-28 17:33:57 -04:00
ioctl.c
Kconfig
Makefile ext4: use bio layer instead of buffer layer in mpage_da_submit_io 2010-10-27 21:30:10 -04:00
mballoc.c ext4: Don't call sb_issue_discard() in ext4_free_blocks() 2010-11-08 13:49:33 -05:00
mballoc.h
migrate.c ext4: rename {ext,idx}_pblock and inline small extent functions 2010-10-27 21:30:14 -04:00
move_extent.c ext4: rename {ext,idx}_pblock and inline small extent functions 2010-10-27 21:30:14 -04:00
namei.c Merge branch 'next' into upstream-merge 2010-10-27 23:44:47 -04:00
page-io.c ext4: fix potential race when freeing ext4_io_page structures 2010-11-08 13:45:33 -05:00
resize.c Merge branch 'next' into upstream-merge 2010-10-27 23:44:47 -04:00
super.c ext4: do not try to grab the s_umount semaphore in ext4_quota_off 2010-11-08 13:47:33 -05:00
symlink.c
xattr_security.c
xattr_trusted.c
xattr_user.c
xattr.c ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*() 2010-10-27 21:30:14 -04:00
xattr.h ext4: fix compile with CONFIG_EXT4_FS_XATTR disabled 2010-10-28 09:29:17 -07:00