diff options
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 96f3366f59f6..4e7f363e3030 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -4965,7 +4965,8 @@ static int ext4_index_trans_blocks(struct inode *inode, int nrblocks, int chunk) | |||
4965 | */ | 4965 | */ |
4966 | int ext4_meta_trans_blocks(struct inode *inode, int nrblocks, int chunk) | 4966 | int ext4_meta_trans_blocks(struct inode *inode, int nrblocks, int chunk) |
4967 | { | 4967 | { |
4968 | int groups, gdpblocks; | 4968 | ext4_group_t groups, ngroups = ext4_get_groups_count(inode->i_sb); |
4969 | int gdpblocks; | ||
4969 | int idxblocks; | 4970 | int idxblocks; |
4970 | int ret = 0; | 4971 | int ret = 0; |
4971 | 4972 | ||
@@ -4992,8 +4993,8 @@ int ext4_meta_trans_blocks(struct inode *inode, int nrblocks, int chunk) | |||
4992 | groups += nrblocks; | 4993 | groups += nrblocks; |
4993 | 4994 | ||
4994 | gdpblocks = groups; | 4995 | gdpblocks = groups; |
4995 | if (groups > EXT4_SB(inode->i_sb)->s_groups_count) | 4996 | if (groups > ngroups) |
4996 | groups = EXT4_SB(inode->i_sb)->s_groups_count; | 4997 | groups = ngroups; |
4997 | if (groups > EXT4_SB(inode->i_sb)->s_gdb_count) | 4998 | if (groups > EXT4_SB(inode->i_sb)->s_gdb_count) |
4998 | gdpblocks = EXT4_SB(inode->i_sb)->s_gdb_count; | 4999 | gdpblocks = EXT4_SB(inode->i_sb)->s_gdb_count; |
4999 | 5000 | ||