summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-04-29 15:38:33 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:41:41 -0800
commit0eb9452996504ef2e1c66ab1e6959c1e1a9ceae6 (patch)
tree4cb7b5b0a62b8f768af6e2600017f796e874aa72 /fs
parent52c5332dabb730ce05156baee482db42fb285698 (diff)
fs: ext4: Fix computation of inodes per block group
857ac889cce8a486d47874db4d2f9620e7e9e5de (ext4: add interface to advertise ext4 features in sysfs) added an error check that exposes a bug in the computation of sbi->s_itb_per_group. If the number of inodes per group is not a multiple of the number of inodes per block, Original-Change-Id: I8c60817dbb6feb43535b567ec7ea5ee0af709c37 Signed-off-by: Colin Cross <ccross@android.com> (cherry picked from commit 8703a0ccb0135ae0de0d7011f29eeb6dc1caa486) Rebase-Id: R7fc03850010d565447bb8702710040f112705738
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 44d0c8db2239..98250f20a0be 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3345,8 +3345,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
sbi->s_inodes_per_block = blocksize / EXT4_INODE_SIZE(sb);
if (sbi->s_inodes_per_block == 0)
goto cantfind_ext4;
- sbi->s_itb_per_group = sbi->s_inodes_per_group /
- sbi->s_inodes_per_block;
+ sbi->s_itb_per_group = DIV_ROUND_UP(sbi->s_inodes_per_group,
+ sbi->s_inodes_per_block);
sbi->s_desc_per_block = blocksize / EXT4_DESC_SIZE(sb);
sbi->s_sbh = bh;
sbi->s_mount_state = le16_to_cpu(es->s_state);