diff options
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 748c9136a60a..dbfe15c2533c 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -3155,9 +3155,8 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac, | |||
3155 | "start %lu, size %lu, fe_logical %lu", | 3155 | "start %lu, size %lu, fe_logical %lu", |
3156 | (unsigned long) start, (unsigned long) size, | 3156 | (unsigned long) start, (unsigned long) size, |
3157 | (unsigned long) ac->ac_o_ex.fe_logical); | 3157 | (unsigned long) ac->ac_o_ex.fe_logical); |
3158 | BUG(); | ||
3158 | } | 3159 | } |
3159 | BUG_ON(start + size <= ac->ac_o_ex.fe_logical && | ||
3160 | start > ac->ac_o_ex.fe_logical); | ||
3161 | BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb)); | 3160 | BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb)); |
3162 | 3161 | ||
3163 | /* now prepare goal request */ | 3162 | /* now prepare goal request */ |
@@ -4410,14 +4409,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, | |||
4410 | if (IS_NOQUOTA(ar->inode)) | 4409 | if (IS_NOQUOTA(ar->inode)) |
4411 | ar->flags |= EXT4_MB_USE_ROOT_BLOCKS; | 4410 | ar->flags |= EXT4_MB_USE_ROOT_BLOCKS; |
4412 | 4411 | ||
4413 | /* | 4412 | if ((ar->flags & EXT4_MB_DELALLOC_RESERVED) == 0) { |
4414 | * For delayed allocation, we could skip the ENOSPC and | ||
4415 | * EDQUOT check, as blocks and quotas have been already | ||
4416 | * reserved when data being copied into pagecache. | ||
4417 | */ | ||
4418 | if (ext4_test_inode_state(ar->inode, EXT4_STATE_DELALLOC_RESERVED)) | ||
4419 | ar->flags |= EXT4_MB_DELALLOC_RESERVED; | ||
4420 | else { | ||
4421 | /* Without delayed allocation we need to verify | 4413 | /* Without delayed allocation we need to verify |
4422 | * there is enough free blocks to do block allocation | 4414 | * there is enough free blocks to do block allocation |
4423 | * and verify allocation doesn't exceed the quota limits. | 4415 | * and verify allocation doesn't exceed the quota limits. |
@@ -4528,8 +4520,7 @@ out: | |||
4528 | if (inquota && ar->len < inquota) | 4520 | if (inquota && ar->len < inquota) |
4529 | dquot_free_block(ar->inode, EXT4_C2B(sbi, inquota - ar->len)); | 4521 | dquot_free_block(ar->inode, EXT4_C2B(sbi, inquota - ar->len)); |
4530 | if (!ar->len) { | 4522 | if (!ar->len) { |
4531 | if (!ext4_test_inode_state(ar->inode, | 4523 | if ((ar->flags & EXT4_MB_DELALLOC_RESERVED) == 0) |
4532 | EXT4_STATE_DELALLOC_RESERVED)) | ||
4533 | /* release all the reserved blocks if non delalloc */ | 4524 | /* release all the reserved blocks if non delalloc */ |
4534 | percpu_counter_sub(&sbi->s_dirtyclusters_counter, | 4525 | percpu_counter_sub(&sbi->s_dirtyclusters_counter, |
4535 | reserv_clstrs); | 4526 | reserv_clstrs); |