aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/migrate.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/migrate.c')
-rw-r--r--fs/ext4/migrate.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index d3567f27bae7..a432634f2e6a 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -41,8 +41,7 @@ static int finish_range(handle_t *handle, struct inode *inode,
41 ext4_ext_store_pblock(&newext, lb->first_pblock); 41 ext4_ext_store_pblock(&newext, lb->first_pblock);
42 /* Locking only for convinience since we are operating on temp inode */ 42 /* Locking only for convinience since we are operating on temp inode */
43 down_write(&EXT4_I(inode)->i_data_sem); 43 down_write(&EXT4_I(inode)->i_data_sem);
44 path = ext4_ext_find_extent(inode, lb->first_block, NULL, 0); 44 path = ext4_find_extent(inode, lb->first_block, NULL, 0);
45
46 if (IS_ERR(path)) { 45 if (IS_ERR(path)) {
47 retval = PTR_ERR(path); 46 retval = PTR_ERR(path);
48 path = NULL; 47 path = NULL;
@@ -81,13 +80,11 @@ static int finish_range(handle_t *handle, struct inode *inode,
81 goto err_out; 80 goto err_out;
82 } 81 }
83 } 82 }
84 retval = ext4_ext_insert_extent(handle, inode, path, &newext, 0); 83 retval = ext4_ext_insert_extent(handle, inode, &path, &newext, 0);
85err_out: 84err_out:
86 up_write((&EXT4_I(inode)->i_data_sem)); 85 up_write((&EXT4_I(inode)->i_data_sem));
87 if (path) { 86 ext4_ext_drop_refs(path);
88 ext4_ext_drop_refs(path); 87 kfree(path);
89 kfree(path);
90 }
91 lb->first_pblock = 0; 88 lb->first_pblock = 0;
92 return retval; 89 return retval;
93} 90}