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>hifive-unleashed-5.1
parent
e2cbd58741
commit
8dc79ec4c0
|
@ -5314,11 +5314,18 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle,
|
||||||
* enough to accomodate the shift.
|
* enough to accomodate the shift.
|
||||||
*/
|
*/
|
||||||
path = ext4_ext_find_extent(inode, start - 1, NULL, 0);
|
path = ext4_ext_find_extent(inode, start - 1, NULL, 0);
|
||||||
|
if (IS_ERR(path))
|
||||||
|
return PTR_ERR(path);
|
||||||
depth = path->p_depth;
|
depth = path->p_depth;
|
||||||
extent = path[depth].p_ext;
|
extent = path[depth].p_ext;
|
||||||
ex_start = le32_to_cpu(extent->ee_block);
|
if (extent) {
|
||||||
ex_end = le32_to_cpu(extent->ee_block) +
|
ex_start = le32_to_cpu(extent->ee_block);
|
||||||
|
ex_end = le32_to_cpu(extent->ee_block) +
|
||||||
ext4_ext_get_actual_len(extent);
|
ext4_ext_get_actual_len(extent);
|
||||||
|
} else {
|
||||||
|
ex_start = 0;
|
||||||
|
ex_end = 0;
|
||||||
|
}
|
||||||
ext4_ext_drop_refs(path);
|
ext4_ext_drop_refs(path);
|
||||||
kfree(path);
|
kfree(path);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue