linux-stable-rt/fs/ext3
Jan Kara bd1939de90 ext3: fix lock inversion in direct IO
We cannot start transaction in ext3_direct_IO() and just let it last during
the whole write because dio_get_page() acquires mmap_sem which ranks above
transaction start (e.g.  because we have dependency chain
mmap_sem->PageLock->journal_start, or because we update atime while holding
mmap_sem) and thus deadlocks could happen.  We solve the problem by
starting a transaction separately for each ext3_get_block() call.

We *could* have a problem that we allocate a block and before its data are
written out the machine crashes and thus we expose stale data.  But that
does not happen because for hole-filling generic code falls back to
buffered writes and for file extension, we add inode to orphan list and
thus in case of crash, journal replay will truncate inode back to the
original size.

[akpm@linux-foundation.org: build fix]
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>
Cc: Zach Brown <zach.brown@oracle.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:21 -08:00
..
Makefile
acl.c
acl.h
balloc.c ext[234]: cleanup ext[234]_bg_num_gdb() 2008-02-06 10:41:21 -08:00
bitmap.c
dir.c Fix 64KB blocksize in ext3 directories 2007-11-14 18:45:43 -08:00
ext3_jbd.c
file.c
fsync.c sparse pointer use of zero as null 2007-10-18 14:37:31 -07:00
hash.c
ialloc.c
inode.c ext3: fix lock inversion in direct IO 2008-02-06 10:41:21 -08:00
ioctl.c Forbid user to change file flags on quota files 2007-11-14 18:45:38 -08:00
namei.c ext3: remove unused code from ext3_find_entry() 2008-02-06 10:41:21 -08:00
namei.h
resize.c ext3: fix setup_new_group_blocks locking 2007-10-18 14:37:29 -07:00
super.c ext[234]: use ext[234]_get_group_desc() 2008-02-06 10:41:21 -08:00
symlink.c
xattr.c JBD/ext3 cleanups: convert to kzalloc 2007-10-19 11:53:34 -07:00
xattr.h
xattr_security.c
xattr_trusted.c
xattr_user.c