diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2008-01-28 23:58:27 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-01-28 23:58:27 -0500 |
commit | c278bfecebfb1ed67c326ef472660878baa745cd (patch) | |
tree | 7207594cef5bd04ea7333a8321d78aefee01a540 /include/linux/ext4_fs.h | |
parent | 01f4adc04480a4e0395906d0268c056cf09c39c0 (diff) |
ext4: Make ext4_get_blocks_wrap take the truncate_mutex early.
When doing a migrate from ext3 to ext4 inode we need to make sure the test
for inode type and walking inode data happens inside lock. To make this
happen move truncate_mutex early before checking the i_flags.
This actually should enable us to remove the verify_chain().
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/ext4_fs.h')
-rw-r--r-- | include/linux/ext4_fs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index 55a376e7bca0..583049c1d366 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h | |||
@@ -1113,6 +1113,7 @@ ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, | |||
1113 | int create, int extend_disksize) | 1113 | int create, int extend_disksize) |
1114 | { | 1114 | { |
1115 | int retval; | 1115 | int retval; |
1116 | mutex_lock(&EXT4_I(inode)->truncate_mutex); | ||
1116 | if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) { | 1117 | if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) { |
1117 | retval = ext4_ext_get_blocks(handle, inode, | 1118 | retval = ext4_ext_get_blocks(handle, inode, |
1118 | (ext4_lblk_t)block, max_blocks, | 1119 | (ext4_lblk_t)block, max_blocks, |
@@ -1122,6 +1123,7 @@ ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, | |||
1122 | (ext4_lblk_t)block, max_blocks, | 1123 | (ext4_lblk_t)block, max_blocks, |
1123 | bh, create, extend_disksize); | 1124 | bh, create, extend_disksize); |
1124 | } | 1125 | } |
1126 | mutex_unlock(&EXT4_I(inode)->truncate_mutex); | ||
1125 | return retval; | 1127 | return retval; |
1126 | } | 1128 | } |
1127 | 1129 | ||