aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/move_extent.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 5a106e02fd9c..3478889e00b3 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -1289,10 +1289,6 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp,
1289 ext4_ext_get_actual_len(ext_cur), block_end + 1) - 1289 ext4_ext_get_actual_len(ext_cur), block_end + 1) -
1290 max(le32_to_cpu(ext_cur->ee_block), block_start); 1290 max(le32_to_cpu(ext_cur->ee_block), block_start);
1291 1291
1292 /* Discard preallocations of two inodes */
1293 ext4_discard_preallocations(orig_inode);
1294 ext4_discard_preallocations(donor_inode);
1295
1296 while (!last_extent && le32_to_cpu(ext_cur->ee_block) <= block_end) { 1292 while (!last_extent && le32_to_cpu(ext_cur->ee_block) <= block_end) {
1297 seq_blocks += add_blocks; 1293 seq_blocks += add_blocks;
1298 1294
@@ -1410,6 +1406,11 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp,
1410 1406
1411 } 1407 }
1412out: 1408out:
1409 if (*moved_len) {
1410 ext4_discard_preallocations(orig_inode);
1411 ext4_discard_preallocations(donor_inode);
1412 }
1413
1413 if (orig_path) { 1414 if (orig_path) {
1414 ext4_ext_drop_refs(orig_path); 1415 ext4_ext_drop_refs(orig_path);
1415 kfree(orig_path); 1416 kfree(orig_path);