summaryrefslogtreecommitdiffstats
path: root/crypto/sha1_generic.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-02-06 01:40:21 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 10:41:21 -0800
commitbd1939de9061dbc5cac44ffb4425aaf4c9b894f1 (patch)
tree99cc44f2b92db9dba1391c81638f7755603c0199 /crypto/sha1_generic.c
parentd8fd66aaea7fe3e4f1ea044a563f129e3b9f05ff (diff)
downloadtalos-obmc-linux-bd1939de9061dbc5cac44ffb4425aaf4c9b894f1.tar.gz
talos-obmc-linux-bd1939de9061dbc5cac44ffb4425aaf4c9b894f1.zip
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>
Diffstat (limited to 'crypto/sha1_generic.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud