diff options
author | Jan Kara <[email protected]> | 2008-02-06 01:40:21 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2008-02-06 10:41:21 -0800 |
commit | bd1939de9061dbc5cac44ffb4425aaf4c9b894f1 (patch) | |
tree | 99cc44f2b92db9dba1391c81638f7755603c0199 /net/unix/sysctl_net_unix.c | |
parent | d8fd66aaea7fe3e4f1ea044a563f129e3b9f05ff (diff) |
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.
[[email protected]: build fix]
Signed-off-by: Jan Kara <[email protected]>
Cc: <[email protected]>
Cc: Zach Brown <[email protected]>
Cc: Badari Pulavarty <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions