diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/extents.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 7e37018d1753..69df02ff96aa 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -3067,6 +3067,7 @@ static int ext4_split_extent(handle_t *handle, | |||
3067 | int err = 0; | 3067 | int err = 0; |
3068 | int uninitialized; | 3068 | int uninitialized; |
3069 | int split_flag1, flags1; | 3069 | int split_flag1, flags1; |
3070 | int allocated = map->m_len; | ||
3070 | 3071 | ||
3071 | depth = ext_depth(inode); | 3072 | depth = ext_depth(inode); |
3072 | ex = path[depth].p_ext; | 3073 | ex = path[depth].p_ext; |
@@ -3086,6 +3087,8 @@ static int ext4_split_extent(handle_t *handle, | |||
3086 | map->m_lblk + map->m_len, split_flag1, flags1); | 3087 | map->m_lblk + map->m_len, split_flag1, flags1); |
3087 | if (err) | 3088 | if (err) |
3088 | goto out; | 3089 | goto out; |
3090 | } else { | ||
3091 | allocated = ee_len - (map->m_lblk - ee_block); | ||
3089 | } | 3092 | } |
3090 | /* | 3093 | /* |
3091 | * Update path is required because previous ext4_split_extent_at() may | 3094 | * Update path is required because previous ext4_split_extent_at() may |
@@ -3115,7 +3118,7 @@ static int ext4_split_extent(handle_t *handle, | |||
3115 | 3118 | ||
3116 | ext4_ext_show_leaf(inode, path); | 3119 | ext4_ext_show_leaf(inode, path); |
3117 | out: | 3120 | out: |
3118 | return err ? err : map->m_len; | 3121 | return err ? err : allocated; |
3119 | } | 3122 | } |
3120 | 3123 | ||
3121 | /* | 3124 | /* |
@@ -3730,6 +3733,7 @@ out: | |||
3730 | allocated - map->m_len); | 3733 | allocated - map->m_len); |
3731 | allocated = map->m_len; | 3734 | allocated = map->m_len; |
3732 | } | 3735 | } |
3736 | map->m_len = allocated; | ||
3733 | 3737 | ||
3734 | /* | 3738 | /* |
3735 | * If we have done fallocate with the offset that is already | 3739 | * If we have done fallocate with the offset that is already |