aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 12b604abc2fe..d47a80ec231d 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4283,7 +4283,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
4283 * EDQUOT check, as blocks and quotas have been already 4283 * EDQUOT check, as blocks and quotas have been already
4284 * reserved when data being copied into pagecache. 4284 * reserved when data being copied into pagecache.
4285 */ 4285 */
4286 if (EXT4_I(ar->inode)->i_delalloc_reserved_flag) 4286 if (ext4_test_inode_state(ar->inode, EXT4_STATE_DELALLOC_RESERVED))
4287 ar->flags |= EXT4_MB_DELALLOC_RESERVED; 4287 ar->flags |= EXT4_MB_DELALLOC_RESERVED;
4288 else { 4288 else {
4289 /* Without delayed allocation we need to verify 4289 /* Without delayed allocation we need to verify
@@ -4380,7 +4380,8 @@ out:
4380 if (inquota && ar->len < inquota) 4380 if (inquota && ar->len < inquota)
4381 dquot_free_block(ar->inode, inquota - ar->len); 4381 dquot_free_block(ar->inode, inquota - ar->len);
4382 if (!ar->len) { 4382 if (!ar->len) {
4383 if (!EXT4_I(ar->inode)->i_delalloc_reserved_flag) 4383 if (!ext4_test_inode_state(ar->inode,
4384 EXT4_STATE_DELALLOC_RESERVED))
4384 /* release all the reserved blocks if non delalloc */ 4385 /* release all the reserved blocks if non delalloc */
4385 percpu_counter_sub(&sbi->s_dirtyblocks_counter, 4386 percpu_counter_sub(&sbi->s_dirtyblocks_counter,
4386 reserv_blks); 4387 reserv_blks);