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
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 497 bytes |
Makefile | -rw-r--r-- | 329 bytes |
ast.c | -rw-r--r-- | 3.7 KB |
ast.h | -rw-r--r-- | 859 bytes |
config.c | -rw-r--r-- | 23.2 KB |
config.h | -rw-r--r-- | 1.4 KB |
debug_fs.c | -rw-r--r-- | 11.9 KB |
dir.c | -rw-r--r-- | 10.0 KB |
dir.h | -rw-r--r-- | 1.2 KB |
dlm_internal.h | -rw-r--r-- | 15.9 KB |
lock.c | -rw-r--r-- | 117.8 KB |
lock.h | -rw-r--r-- | 2.6 KB |
lockspace.c | -rw-r--r-- | 16.8 KB |
lockspace.h | -rw-r--r-- | 1016 bytes |
lowcomms.c | -rw-r--r-- | 36.1 KB |
lowcomms.h | -rw-r--r-- | 971 bytes |
lvb_table.h | -rw-r--r-- | 687 bytes |
main.c | -rw-r--r-- | 1.9 KB |
member.c | -rw-r--r-- | 8.2 KB |
member.h | -rw-r--r-- | 1.0 KB |
memory.c | -rw-r--r-- | 2.0 KB |
memory.h | -rw-r--r-- | 1.0 KB |
midcomms.c | -rw-r--r-- | 3.7 KB |
midcomms.h | -rw-r--r-- | 864 bytes |
netlink.c | -rw-r--r-- | 3.0 KB |
rcom.c | -rw-r--r-- | 12.9 KB |
rcom.h | -rw-r--r-- | 1.1 KB |
recover.c | -rw-r--r-- | 18.9 KB |
recover.h | -rw-r--r-- | 1.5 KB |
recoverd.c | -rw-r--r-- | 7.3 KB |
recoverd.h | -rw-r--r-- | 970 bytes |
requestqueue.c | -rw-r--r-- | 5.3 KB |
requestqueue.h | -rw-r--r-- | 882 bytes |
user.c | -rw-r--r-- | 22.1 KB |
user.h | -rw-r--r-- | 416 bytes |
util.c | -rw-r--r-- | 4.5 KB |
util.h | -rw-r--r-- | 805 bytes |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...