diff options
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r-- | fs/ext4/balloc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index d2f37a5516c7..bd30799a43ed 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -377,14 +377,11 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb, | |||
377 | ext4_grpblk_t bit; | 377 | ext4_grpblk_t bit; |
378 | unsigned int i; | 378 | unsigned int i; |
379 | struct ext4_group_desc *desc; | 379 | struct ext4_group_desc *desc; |
380 | struct ext4_super_block *es; | 380 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
381 | struct ext4_sb_info *sbi; | ||
382 | int err = 0, ret, blk_free_count; | 381 | int err = 0, ret, blk_free_count; |
383 | ext4_grpblk_t blocks_freed; | 382 | ext4_grpblk_t blocks_freed; |
384 | struct ext4_group_info *grp; | 383 | struct ext4_group_info *grp; |
385 | 384 | ||
386 | sbi = EXT4_SB(sb); | ||
387 | es = sbi->s_es; | ||
388 | ext4_debug("Adding block(s) %llu-%llu\n", block, block + count - 1); | 385 | ext4_debug("Adding block(s) %llu-%llu\n", block, block + count - 1); |
389 | 386 | ||
390 | ext4_get_group_no_and_offset(sb, block, &block_group, &bit); | 387 | ext4_get_group_no_and_offset(sb, block, &block_group, &bit); |
@@ -477,7 +474,6 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb, | |||
477 | ret = ext4_handle_dirty_metadata(handle, NULL, gd_bh); | 474 | ret = ext4_handle_dirty_metadata(handle, NULL, gd_bh); |
478 | if (!err) | 475 | if (!err) |
479 | err = ret; | 476 | err = ret; |
480 | sb->s_dirt = 1; | ||
481 | 477 | ||
482 | error_return: | 478 | error_return: |
483 | brelse(bitmap_bh); | 479 | brelse(bitmap_bh); |
@@ -591,14 +587,15 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode, | |||
591 | ret = ext4_mb_new_blocks(handle, &ar, errp); | 587 | ret = ext4_mb_new_blocks(handle, &ar, errp); |
592 | if (count) | 588 | if (count) |
593 | *count = ar.len; | 589 | *count = ar.len; |
594 | |||
595 | /* | 590 | /* |
596 | * Account for the allocated meta blocks | 591 | * Account for the allocated meta blocks. We will never |
592 | * fail EDQUOT for metdata, but we do account for it. | ||
597 | */ | 593 | */ |
598 | if (!(*errp) && EXT4_I(inode)->i_delalloc_reserved_flag) { | 594 | if (!(*errp) && EXT4_I(inode)->i_delalloc_reserved_flag) { |
599 | spin_lock(&EXT4_I(inode)->i_block_reservation_lock); | 595 | spin_lock(&EXT4_I(inode)->i_block_reservation_lock); |
600 | EXT4_I(inode)->i_allocated_meta_blocks += ar.len; | 596 | EXT4_I(inode)->i_allocated_meta_blocks += ar.len; |
601 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); | 597 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); |
598 | dquot_alloc_block_nofail(inode, ar.len); | ||
602 | } | 599 | } |
603 | return ret; | 600 | return ret; |
604 | } | 601 | } |