aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/resize.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2009-01-05 21:36:02 -0500
committerTheodore Ts'o <tytso@mit.edu>2009-01-05 21:36:02 -0500
commite21675d4b63975d09eb75c443c48ebe663d23e18 (patch)
tree73ace586265c977c2f0b41bbe2ec0b462809aa58 /fs/ext4/resize.c
parent3a06d778dfeda7eaeeb79bfa49cf97f2aae132b4 (diff)
ext4: Add blocks added during resize to bitmap
With this change new blocks added during resize are marked as free in the block bitmap and the group is flagged with EXT4_GROUP_INFO_NEED_INIT_BIT flag. This makes sure when mballoc tries to allocate blocks from the new group we would reload the buddy information using the bitmap present in the disk. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> 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.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 1865d6a53de3..526db73701b4 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -977,9 +977,7 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
977 struct buffer_head *bh; 977 struct buffer_head *bh;
978 handle_t *handle; 978 handle_t *handle;
979 int err; 979 int err;
980 unsigned long freed_blocks;
981 ext4_group_t group; 980 ext4_group_t group;
982 struct ext4_group_info *grp;
983 981
984 /* We don't need to worry about locking wrt other resizers just 982 /* We don't need to worry about locking wrt other resizers just
985 * yet: we're going to revalidate es->s_blocks_count after 983 * yet: we're going to revalidate es->s_blocks_count after
@@ -1077,7 +1075,8 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
1077 unlock_super(sb); 1075 unlock_super(sb);
1078 ext4_debug("freeing blocks %llu through %llu\n", o_blocks_count, 1076 ext4_debug("freeing blocks %llu through %llu\n", o_blocks_count,
1079 o_blocks_count + add); 1077 o_blocks_count + add);
1080 ext4_free_blocks_sb(handle, sb, o_blocks_count, add, &freed_blocks); 1078 /* We add the blocks to the bitmap and set the group need init bit */
1079 ext4_add_groupblocks(handle, sb, o_blocks_count, add);
1081 ext4_debug("freed blocks %llu through %llu\n", o_blocks_count, 1080 ext4_debug("freed blocks %llu through %llu\n", o_blocks_count,
1082 o_blocks_count + add); 1081 o_blocks_count + add);
1083 if ((err = ext4_journal_stop(handle))) 1082 if ((err = ext4_journal_stop(handle)))
@@ -1120,12 +1119,6 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
1120 ClearPageUptodate(page); 1119 ClearPageUptodate(page);
1121 page_cache_release(page); 1120 page_cache_release(page);
1122 } 1121 }
1123
1124 /* Get the info on the last group */
1125 grp = ext4_get_group_info(sb, group);
1126
1127 /* Update free blocks in group info */
1128 ext4_mb_update_group_info(grp, add);
1129 } 1122 }
1130 1123
1131 if (test_opt(sb, DEBUG)) 1124 if (test_opt(sb, DEBUG))