aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e991ae2b461c..715264b4bae4 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2807,6 +2807,8 @@ fix_extent_len:
2807 * into three uninitialized extent(at most). After IO complete, the part 2807 * into three uninitialized extent(at most). After IO complete, the part
2808 * being filled will be convert to initialized by the end_io callback function 2808 * being filled will be convert to initialized by the end_io callback function
2809 * via ext4_convert_unwritten_extents(). 2809 * via ext4_convert_unwritten_extents().
2810 *
2811 * Returns the size of uninitialized extent to be written on success.
2810 */ 2812 */
2811static int ext4_split_unwritten_extents(handle_t *handle, 2813static int ext4_split_unwritten_extents(handle_t *handle,
2812 struct inode *inode, 2814 struct inode *inode,
@@ -2824,7 +2826,6 @@ static int ext4_split_unwritten_extents(handle_t *handle,
2824 unsigned int allocated, ee_len, depth; 2826 unsigned int allocated, ee_len, depth;
2825 ext4_fsblk_t newblock; 2827 ext4_fsblk_t newblock;
2826 int err = 0; 2828 int err = 0;
2827 int ret = 0;
2828 2829
2829 ext_debug("ext4_split_unwritten_extents: inode %lu," 2830 ext_debug("ext4_split_unwritten_extents: inode %lu,"
2830 "iblock %llu, max_blocks %u\n", inode->i_ino, 2831 "iblock %llu, max_blocks %u\n", inode->i_ino,
@@ -2842,12 +2843,12 @@ static int ext4_split_unwritten_extents(handle_t *handle,
2842 ext4_ext_store_pblock(&orig_ex, ext_pblock(ex)); 2843 ext4_ext_store_pblock(&orig_ex, ext_pblock(ex));
2843 2844
2844 /* 2845 /*
2845 * if the entire unintialized extent length less than 2846 * If the uninitialized extent begins at the same logical
2846 * the size of extent to write, there is no need to split 2847 * block where the write begins, and the write completely
2847 * uninitialized extent 2848 * covers the extent, then we don't need to split it.
2848 */ 2849 */
2849 if (allocated <= max_blocks) 2850 if ((iblock == ee_block) && (allocated <= max_blocks))
2850 return ret; 2851 return allocated;
2851 2852
2852 err = ext4_ext_get_access(handle, inode, path + depth); 2853 err = ext4_ext_get_access(handle, inode, path + depth);
2853 if (err) 2854 if (err)