diff options
author | Aditya Kali <adityakali@google.com> | 2011-09-09 19:04:51 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-09 19:04:51 -0400 |
commit | 7b415bf60f6afb0499fd3dc0ee33444f54e28567 (patch) | |
tree | 9c64fef2b8d60ce64865af6e4c2cc6008026e28c /fs/ext4/mballoc.c | |
parent | 27baebb849d46d901e756e6502b0a65a62e43771 (diff) |
ext4: Fix bigalloc quota accounting and i_blocks value
With bigalloc changes, the i_blocks value was not correctly set (it was still
set to number of blocks being used, but in case of bigalloc, we want i_blocks
to represent the number of clusters being used). Since the quota subsystem sets
the i_blocks value, this patch fixes the quota accounting and makes sure that
the i_blocks value is set correctly.
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 63dd56703342..5e1215d38331 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -4718,6 +4718,9 @@ do_more: | |||
4718 | 4718 | ||
4719 | freed += count; | 4719 | freed += count; |
4720 | 4720 | ||
4721 | if (!(flags & EXT4_FREE_BLOCKS_NO_QUOT_UPDATE)) | ||
4722 | dquot_free_block(inode, EXT4_C2B(sbi, count_clusters)); | ||
4723 | |||
4721 | /* We dirtied the bitmap block */ | 4724 | /* We dirtied the bitmap block */ |
4722 | BUFFER_TRACE(bitmap_bh, "dirtied bitmap block"); | 4725 | BUFFER_TRACE(bitmap_bh, "dirtied bitmap block"); |
4723 | err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh); | 4726 | err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh); |
@@ -4736,8 +4739,6 @@ do_more: | |||
4736 | } | 4739 | } |
4737 | ext4_mark_super_dirty(sb); | 4740 | ext4_mark_super_dirty(sb); |
4738 | error_return: | 4741 | error_return: |
4739 | if (freed && !(flags & EXT4_FREE_BLOCKS_NO_QUOT_UPDATE)) | ||
4740 | dquot_free_block(inode, freed); | ||
4741 | brelse(bitmap_bh); | 4742 | brelse(bitmap_bh); |
4742 | ext4_std_error(sb, err); | 4743 | ext4_std_error(sb, err); |
4743 | return; | 4744 | return; |