aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/resize.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2012-07-09 16:27:05 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-07-09 16:27:05 -0400
commit952fc18ef9ec707ebdc16c0786ec360295e5ff15 (patch)
treebd93a2c400c4a50b17b677c3b46d92c71651b2aa /fs/ext4/resize.c
parentf6fb99cadcd44660c68e13f6eab28333653621e6 (diff)
ext4: fix overhead calculation used by ext4_statfs()
Commit f975d6bcc7a introduced bug which caused ext4_statfs() to miscalculate the number of file system overhead blocks. This causes the f_blocks field in the statfs structure to be larger than it should be. This would in turn cause the "df" output to show the number of data blocks in the file system and the number of data blocks used to be larger than they should be. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@kernel.org
Diffstat (limited to 'fs/ext4/resize.c')
-rw-r--r--fs/ext4/resize.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 7ea6cbb44121..17d38de4068c 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1197,7 +1197,7 @@ static void ext4_update_super(struct super_block *sb,
1197 struct ext4_new_group_data *group_data = flex_gd->groups; 1197 struct ext4_new_group_data *group_data = flex_gd->groups;
1198 struct ext4_sb_info *sbi = EXT4_SB(sb); 1198 struct ext4_sb_info *sbi = EXT4_SB(sb);
1199 struct ext4_super_block *es = sbi->s_es; 1199 struct ext4_super_block *es = sbi->s_es;
1200 int i; 1200 int i, ret;
1201 1201
1202 BUG_ON(flex_gd->count == 0 || group_data == NULL); 1202 BUG_ON(flex_gd->count == 0 || group_data == NULL);
1203 /* 1203 /*
@@ -1272,6 +1272,11 @@ static void ext4_update_super(struct super_block *sb,
1272 &sbi->s_flex_groups[flex_group].free_inodes); 1272 &sbi->s_flex_groups[flex_group].free_inodes);
1273 } 1273 }
1274 1274
1275 /*
1276 * Update the fs overhead information
1277 */
1278 ext4_calculate_overhead(sb);
1279
1275 if (test_opt(sb, DEBUG)) 1280 if (test_opt(sb, DEBUG))
1276 printk(KERN_DEBUG "EXT4-fs: added group %u:" 1281 printk(KERN_DEBUG "EXT4-fs: added group %u:"
1277 "%llu blocks(%llu free %llu reserved)\n", flex_gd->count, 1282 "%llu blocks(%llu free %llu reserved)\n", flex_gd->count,