aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorAllison Henderson <achender@linux.vnet.ibm.com>2011-05-16 10:11:09 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-05-16 10:11:09 -0400
commit9b940f8e8c32456c8a6428fa4313a4bcca7b4fcb (patch)
tree24b784d45ad077461bdc76faf5e0fa0125eed0ec /fs/ext4/extents.c
parent0b26859027ce0005ef89520af20351360e51ad76 (diff)
ext4: ext4_ext_convert_to_initialized bug found in extended FSX testing
This patch addresses bugs found while testing punch hole with the fsx test. The patch corrects the number of blocks that are zeroed out while splitting an extent, and also corrects the return value to return the number of blocks split out, instead of the number of blocks zeroed out. This patch has been tested in addition to the following patches: [Ext4 punch hole v7] [XFS Tests Punch Hole 1/1 v2] Add Punch Hole Testing to FSX The test ran successfully for 24 hours. Signed-off-by: Allison Henderson <achender@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e363f21b091b..5f243da8ff1d 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2818,8 +2818,8 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
2818 (EXT4_EXT_MAY_ZEROOUT & split_flag)) { 2818 (EXT4_EXT_MAY_ZEROOUT & split_flag)) {
2819 /* case 3 */ 2819 /* case 3 */
2820 zero_ex.ee_block = 2820 zero_ex.ee_block =
2821 cpu_to_le32(map->m_lblk + map->m_len); 2821 cpu_to_le32(map->m_lblk);
2822 zero_ex.ee_len = cpu_to_le16(allocated - map->m_len); 2822 zero_ex.ee_len = cpu_to_le16(allocated);
2823 ext4_ext_store_pblock(&zero_ex, 2823 ext4_ext_store_pblock(&zero_ex,
2824 ext4_ext_pblock(ex) + map->m_lblk - ee_block); 2824 ext4_ext_pblock(ex) + map->m_lblk - ee_block);
2825 err = ext4_ext_zeroout(inode, &zero_ex); 2825 err = ext4_ext_zeroout(inode, &zero_ex);
@@ -2842,10 +2842,9 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
2842 goto out; 2842 goto out;
2843 } 2843 }
2844 2844
2845 allocated = map->m_lblk - ee_block + map->m_len;
2846
2847 split_map.m_lblk = ee_block; 2845 split_map.m_lblk = ee_block;
2848 split_map.m_len = allocated; 2846 split_map.m_len = map->m_lblk - ee_block + map->m_len;
2847 allocated = map->m_len;
2849 } 2848 }
2850 } 2849 }
2851 2850