diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2014-04-13 15:05:42 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-04-13 15:05:42 -0400 |
commit | 8dc79ec4c0537e1b83c0739af82a7babefb30012 (patch) | |
tree | f05bb659846f3643941fe2ddd4faf96a5cb494bb /fs/ext4 | |
parent | e2cbd587418251bb73c4c1e8e2c7c1816d7a98d9 (diff) |
ext4: fix error handling in ext4_ext_shift_extents
Fix error handling by adding some. :-)
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/extents.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 96e0a4bc8faa..38be06354b88 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -5314,11 +5314,18 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle, | |||
5314 | * enough to accomodate the shift. | 5314 | * enough to accomodate the shift. |
5315 | */ | 5315 | */ |
5316 | path = ext4_ext_find_extent(inode, start - 1, NULL, 0); | 5316 | path = ext4_ext_find_extent(inode, start - 1, NULL, 0); |
5317 | if (IS_ERR(path)) | ||
5318 | return PTR_ERR(path); | ||
5317 | depth = path->p_depth; | 5319 | depth = path->p_depth; |
5318 | extent = path[depth].p_ext; | 5320 | extent = path[depth].p_ext; |
5319 | ex_start = le32_to_cpu(extent->ee_block); | 5321 | if (extent) { |
5320 | ex_end = le32_to_cpu(extent->ee_block) + | 5322 | ex_start = le32_to_cpu(extent->ee_block); |
5323 | ex_end = le32_to_cpu(extent->ee_block) + | ||
5321 | ext4_ext_get_actual_len(extent); | 5324 | ext4_ext_get_actual_len(extent); |
5325 | } else { | ||
5326 | ex_start = 0; | ||
5327 | ex_end = 0; | ||
5328 | } | ||
5322 | ext4_ext_drop_refs(path); | 5329 | ext4_ext_drop_refs(path); |
5323 | kfree(path); | 5330 | kfree(path); |
5324 | 5331 | ||