aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2012-03-20 15:46:11 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-03-20 15:46:11 -0400
commit636d7e2e3b57543636d20cd083079300ccdd569d (patch)
treec3dcb77693d2a2262be5ebc4a2f993d01453b4b6 /fs/ext4
parent92b9781658dba287a1354ad74ed351f68c3ee740 (diff)
ext4: update s_free_{inodes,blocks}_count during online resize
When we're doing an online resize of an ext4 filesystem, we need to update the free inode and block counts in the superblock so that fsck doesn't complain. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/resize.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index b6ad461930c..59fa0be2725 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1163,8 +1163,11 @@ static void ext4_update_super(struct super_block *sb,
1163 do_div(reserved_blocks, 100); 1163 do_div(reserved_blocks, 100);
1164 1164
1165 ext4_blocks_count_set(es, ext4_blocks_count(es) + blocks_count); 1165 ext4_blocks_count_set(es, ext4_blocks_count(es) + blocks_count);
1166 ext4_free_blocks_count_set(es, ext4_free_blocks_count(es) + free_blocks);
1166 le32_add_cpu(&es->s_inodes_count, EXT4_INODES_PER_GROUP(sb) * 1167 le32_add_cpu(&es->s_inodes_count, EXT4_INODES_PER_GROUP(sb) *
1167 flex_gd->count); 1168 flex_gd->count);
1169 le32_add_cpu(&es->s_free_inodes_count, EXT4_INODES_PER_GROUP(sb) *
1170 flex_gd->count);
1168 1171
1169 /* 1172 /*
1170 * We need to protect s_groups_count against other CPUs seeing 1173 * We need to protect s_groups_count against other CPUs seeing
@@ -1465,6 +1468,7 @@ static int ext4_group_extend_no_check(struct super_block *sb,
1465 } 1468 }
1466 1469
1467 ext4_blocks_count_set(es, o_blocks_count + add); 1470 ext4_blocks_count_set(es, o_blocks_count + add);
1471 ext4_free_blocks_count_set(es, ext4_free_blocks_count(es) + add);
1468 ext4_debug("freeing blocks %llu through %llu\n", o_blocks_count, 1472 ext4_debug("freeing blocks %llu through %llu\n", o_blocks_count,
1469 o_blocks_count + add); 1473 o_blocks_count + add);
1470 /* We add the blocks to the bitmap and set the group need init bit */ 1474 /* We add the blocks to the bitmap and set the group need init bit */