android_kernel_xiaomi_sm8350/fs/ext3
Jan Kara 00171d3c7e ext3: Fix possible deadlock between ext3_truncate() and ext3_get_blocks()
During truncate we are sometimes forced to start a new transaction as the
amount of blocks to be journaled is both quite large and hard to predict. So
far we restarted a transaction while holding truncate_mutex and that violates
lock ordering because truncate_mutex ranks below transaction start (and it
can lead to a real deadlock with ext3_get_blocks() allocating new blocks
from ext3_writepage()).

Luckily, the problem is easy to fix: We just drop the truncate_mutex before
restarting the transaction and acquire it afterwards. We are safe to do this as
by the time ext3_truncate() is called, all the page cache for the truncated
part of the file is dropped and so writepage() cannot come and allocate new
blocks in the part of the file we are truncating. The rest of writers is
stopped by us holding i_mutex.

Signed-off-by: Jan Kara <jack@suse.cz>
2009-09-16 17:44:11 +02:00
..
acl.c ext[234]: move over to 'check_acl' permission model 2009-09-08 11:09:04 -07:00
acl.h ext[234]: move over to 'check_acl' permission model 2009-09-08 11:09:04 -07:00
balloc.c ext3: remove ->write_super and stop maintaining ->s_dirt 2009-06-11 21:36:05 -04:00
bitmap.c
dir.c ext3: Get rid of extenddisksize parameter of ext3_get_blocks_handle() 2009-07-15 21:30:46 +02:00
ext3_jbd.c
file.c ext3: Remove syncing logic from ext3_file_write 2009-09-14 17:08:16 +02:00
fsync.c
hash.c ext3: Add support for non-native signed/unsigned htree hash algorithms 2008-10-28 13:21:55 -04:00
ialloc.c ext3: remove ->write_super and stop maintaining ->s_dirt 2009-06-11 21:36:05 -04:00
inode.c ext3: Fix possible deadlock between ext3_truncate() and ext3_get_blocks() 2009-09-16 17:44:11 +02:00
ioctl.c ext3: remove the BKL in ext3/ioctl.c 2009-04-02 19:04:52 -07:00
Kconfig ext3: Update Kconfig description of EXT3_DEFAULTS_TO_ORDERED 2009-08-24 16:48:32 +02:00
Makefile
namei.c ext[234]: move over to 'check_acl' permission model 2009-09-08 11:09:04 -07:00
namei.h
resize.c block: rename CONFIG_LBD to CONFIG_LBDAF 2009-06-19 08:08:50 +02:00
super.c ext3: Improve error message that changing journaling mode on remount is not possible 2009-08-24 16:48:45 +02:00
symlink.c
xattr_security.c
xattr_trusted.c
xattr_user.c
xattr.c ext3: remove ->write_super and stop maintaining ->s_dirt 2009-06-11 21:36:05 -04:00
xattr.h