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)
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>

No differences found