diff options
-rw-r--r-- | fs/ext4/extents.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 627f7ae94ae5..e910720e8bb8 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -3102,7 +3102,7 @@ static void unmap_underlying_metadata_blocks(struct block_device *bdev, | |||
3102 | * Handle EOFBLOCKS_FL flag, clearing it if necessary | 3102 | * Handle EOFBLOCKS_FL flag, clearing it if necessary |
3103 | */ | 3103 | */ |
3104 | static int check_eofblocks_fl(handle_t *handle, struct inode *inode, | 3104 | static int check_eofblocks_fl(handle_t *handle, struct inode *inode, |
3105 | struct ext4_map_blocks *map, | 3105 | ext4_lblk_t lblk, |
3106 | struct ext4_ext_path *path, | 3106 | struct ext4_ext_path *path, |
3107 | unsigned int len) | 3107 | unsigned int len) |
3108 | { | 3108 | { |
@@ -3132,7 +3132,7 @@ static int check_eofblocks_fl(handle_t *handle, struct inode *inode, | |||
3132 | * this turns out to be false, we can bail out from this | 3132 | * this turns out to be false, we can bail out from this |
3133 | * function immediately. | 3133 | * function immediately. |
3134 | */ | 3134 | */ |
3135 | if (map->m_lblk + len < le32_to_cpu(last_ex->ee_block) + | 3135 | if (lblk + len < le32_to_cpu(last_ex->ee_block) + |
3136 | ext4_ext_get_actual_len(last_ex)) | 3136 | ext4_ext_get_actual_len(last_ex)) |
3137 | return 0; | 3137 | return 0; |
3138 | /* | 3138 | /* |
@@ -3188,8 +3188,8 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode, | |||
3188 | path); | 3188 | path); |
3189 | if (ret >= 0) { | 3189 | if (ret >= 0) { |
3190 | ext4_update_inode_fsync_trans(handle, inode, 1); | 3190 | ext4_update_inode_fsync_trans(handle, inode, 1); |
3191 | err = check_eofblocks_fl(handle, inode, map, path, | 3191 | err = check_eofblocks_fl(handle, inode, map->m_lblk, |
3192 | map->m_len); | 3192 | path, map->m_len); |
3193 | } else | 3193 | } else |
3194 | err = ret; | 3194 | err = ret; |
3195 | goto out2; | 3195 | goto out2; |
@@ -3219,7 +3219,8 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode, | |||
3219 | ret = ext4_ext_convert_to_initialized(handle, inode, map, path); | 3219 | ret = ext4_ext_convert_to_initialized(handle, inode, map, path); |
3220 | if (ret >= 0) { | 3220 | if (ret >= 0) { |
3221 | ext4_update_inode_fsync_trans(handle, inode, 1); | 3221 | ext4_update_inode_fsync_trans(handle, inode, 1); |
3222 | err = check_eofblocks_fl(handle, inode, map, path, map->m_len); | 3222 | err = check_eofblocks_fl(handle, inode, map->m_lblk, path, |
3223 | map->m_len); | ||
3223 | if (err < 0) | 3224 | if (err < 0) |
3224 | goto out2; | 3225 | goto out2; |
3225 | } | 3226 | } |
@@ -3472,7 +3473,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, | |||
3472 | map->m_flags |= EXT4_MAP_UNINIT; | 3473 | map->m_flags |= EXT4_MAP_UNINIT; |
3473 | } | 3474 | } |
3474 | 3475 | ||
3475 | err = check_eofblocks_fl(handle, inode, map, path, ar.len); | 3476 | err = check_eofblocks_fl(handle, inode, map->m_lblk, path, ar.len); |
3476 | if (err) | 3477 | if (err) |
3477 | goto out2; | 3478 | goto out2; |
3478 | 3479 | ||