]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: Fix locking hierarchy violation in ext4_fallocate()
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Fri, 15 Feb 2008 17:47:21 +0000 (12:47 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 15 Feb 2008 17:47:21 +0000 (12:47 -0500)
commitcf4c8e63ac70c49a7530737ed71dfc81865ef6c9
tree9e4c092830eafbb0036892d578d4075689ef81df
parent719cf0e87de3f4c2bd12944893fe94bc8fec93bb
ext4: Fix locking hierarchy violation in ext4_fallocate()

ext4_fallocate() was trying to acquire i_data_sem outside of
jbd2_start_transaction/jbd2_journal_stop, which violates ext4's locking
hierarchy.  So we take i_mutex to prevent writes and truncates during
the complete fallocate operation, and use ext4_get_block_wrap() which
acquires and releases i_data_sem for each block allocation.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c