summaryrefslogtreecommitdiffstats
path: root/fs/jbd2
diff options
context:
space:
mode:
authorJan Kara2008-02-10 07:08:38 +0100
committerTheodore Ts'o2008-02-10 07:08:38 +0100
commit7fb5409df092589b86cc9412d926879cb572b7f0 (patch)
tree8201f2fc124d34098776799f8cec89a8f8b4f8bb /fs/jbd2
parentext4: Fix circular locking dependency with migrate and rm. (diff)
downloadkernel-qcow2-linux-7fb5409df092589b86cc9412d926879cb572b7f0.tar.gz
kernel-qcow2-linux-7fb5409df092589b86cc9412d926879cb572b7f0.tar.xz
kernel-qcow2-linux-7fb5409df092589b86cc9412d926879cb572b7f0.zip
ext4: Fix Direct I/O locking
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>
Diffstat (limited to 'fs/jbd2')
0 files changed, 0 insertions, 0 deletions