diff options
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 3ac1686efff8..8170b3254767 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -1933,6 +1933,8 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode, | |||
1933 | ext4_lblk_t next; | 1933 | ext4_lblk_t next; |
1934 | int mb_flags = 0, unwritten; | 1934 | int mb_flags = 0, unwritten; |
1935 | 1935 | ||
1936 | if (gb_flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE) | ||
1937 | mb_flags |= EXT4_MB_DELALLOC_RESERVED; | ||
1936 | if (unlikely(ext4_ext_get_actual_len(newext) == 0)) { | 1938 | if (unlikely(ext4_ext_get_actual_len(newext) == 0)) { |
1937 | EXT4_ERROR_INODE(inode, "ext4_ext_get_actual_len(newext) == 0"); | 1939 | EXT4_ERROR_INODE(inode, "ext4_ext_get_actual_len(newext) == 0"); |
1938 | return -EIO; | 1940 | return -EIO; |
@@ -2054,7 +2056,7 @@ prepend: | |||
2054 | * We're gonna add a new leaf in the tree. | 2056 | * We're gonna add a new leaf in the tree. |
2055 | */ | 2057 | */ |
2056 | if (gb_flags & EXT4_GET_BLOCKS_METADATA_NOFAIL) | 2058 | if (gb_flags & EXT4_GET_BLOCKS_METADATA_NOFAIL) |
2057 | mb_flags = EXT4_MB_USE_RESERVED; | 2059 | mb_flags |= EXT4_MB_USE_RESERVED; |
2058 | err = ext4_ext_create_new_leaf(handle, inode, mb_flags, gb_flags, | 2060 | err = ext4_ext_create_new_leaf(handle, inode, mb_flags, gb_flags, |
2059 | ppath, newext); | 2061 | ppath, newext); |
2060 | if (err) | 2062 | if (err) |
@@ -4438,6 +4440,8 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, | |||
4438 | ar.flags = 0; | 4440 | ar.flags = 0; |
4439 | if (flags & EXT4_GET_BLOCKS_NO_NORMALIZE) | 4441 | if (flags & EXT4_GET_BLOCKS_NO_NORMALIZE) |
4440 | ar.flags |= EXT4_MB_HINT_NOPREALLOC; | 4442 | ar.flags |= EXT4_MB_HINT_NOPREALLOC; |
4443 | if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE) | ||
4444 | ar.flags |= EXT4_MB_DELALLOC_RESERVED; | ||
4441 | newblock = ext4_mb_new_blocks(handle, &ar, &err); | 4445 | newblock = ext4_mb_new_blocks(handle, &ar, &err); |
4442 | if (!newblock) | 4446 | if (!newblock) |
4443 | goto out2; | 4447 | goto out2; |