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/balloc.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/balloc.c')
-rw-r--r-- | fs/ext4/balloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 9080a857cda9..bf42b3219e3c 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -485,7 +485,7 @@ int ext4_should_retry_alloc(struct super_block *sb, int *retries) | |||
485 | * @handle: handle to this transaction | 485 | * @handle: handle to this transaction |
486 | * @inode: file inode | 486 | * @inode: file inode |
487 | * @goal: given target block(filesystem wide) | 487 | * @goal: given target block(filesystem wide) |
488 | * @count: pointer to total number of blocks needed | 488 | * @count: pointer to total number of clusters needed |
489 | * @errp: error code | 489 | * @errp: error code |
490 | * | 490 | * |
491 | * Return 1st allocated block number on success, *count stores total account | 491 | * Return 1st allocated block number on success, *count stores total account |
@@ -517,7 +517,8 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode, | |||
517 | spin_lock(&EXT4_I(inode)->i_block_reservation_lock); | 517 | spin_lock(&EXT4_I(inode)->i_block_reservation_lock); |
518 | EXT4_I(inode)->i_allocated_meta_blocks += ar.len; | 518 | EXT4_I(inode)->i_allocated_meta_blocks += ar.len; |
519 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); | 519 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); |
520 | dquot_alloc_block_nofail(inode, ar.len); | 520 | dquot_alloc_block_nofail(inode, |
521 | EXT4_C2B(EXT4_SB(inode->i_sb), ar.len)); | ||
521 | } | 522 | } |
522 | return ret; | 523 | return ret; |
523 | } | 524 | } |