Revision 7fb5409df092589b86cc9412d926879cb572b7f0 authored by Jan Kara on 10 February 2008, 06:08:38 UTC, committed by Theodore Ts'o on 10 February 2008, 06:08:38 UTC
We cannot start transaction in ext4_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 ext4_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.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

1 parent 8009f9f
History
File Mode Size
Makefile -rw-r--r-- 324 bytes
cache.c -rw-r--r-- 2.9 KB
cnode.c -rw-r--r-- 4.1 KB
coda_int.h -rw-r--r-- 434 bytes
coda_linux.c -rw-r--r-- 5.1 KB
dir.c -rw-r--r-- 16.8 KB
file.c -rw-r--r-- 6.2 KB
inode.c -rw-r--r-- 6.5 KB
pioctl.c -rw-r--r-- 2.4 KB
psdev.c -rw-r--r-- 10.2 KB
symlink.c -rw-r--r-- 1.2 KB
sysctl.c -rw-r--r-- 1.3 KB
upcall.c -rw-r--r-- 22.7 KB

back to top