aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 31ae5fbe89e5..a86213882655 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3565,12 +3565,14 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
3565 3565
3566 err = ext4_ext_insert_extent(handle, inode, path, &newex, flags); 3566 err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
3567 if (err) { 3567 if (err) {
3568 int fb_flags = flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE ?
3569 EXT4_FREE_BLOCKS_NO_QUOT_UPDATE : 0;
3568 /* free data blocks we just allocated */ 3570 /* free data blocks we just allocated */
3569 /* not a good idea to call discard here directly, 3571 /* not a good idea to call discard here directly,
3570 * but otherwise we'd need to call it every free() */ 3572 * but otherwise we'd need to call it every free() */
3571 ext4_discard_preallocations(inode); 3573 ext4_discard_preallocations(inode);
3572 ext4_free_blocks(handle, inode, NULL, ext4_ext_pblock(&newex), 3574 ext4_free_blocks(handle, inode, NULL, ext4_ext_pblock(&newex),
3573 ext4_ext_get_actual_len(&newex), 0); 3575 ext4_ext_get_actual_len(&newex), fb_flags);
3574 goto out2; 3576 goto out2;
3575 } 3577 }
3576 3578