Commit 648f5879 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Theodore Ts'o

ext4: mark the blocks/inode bitmap beyond end of group as used

We need to mark the block/inode bitmap beyond the end of the group
with '1'.
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
parent 2ccb5fb9
...@@ -84,7 +84,7 @@ unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh, ...@@ -84,7 +84,7 @@ unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh,
} }
memset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8); memset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8);
mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), EXT4_BLOCKS_PER_GROUP(sb), mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), sb->s_blocksize * 8,
bh->b_data); bh->b_data);
return EXT4_INODES_PER_GROUP(sb); return EXT4_INODES_PER_GROUP(sb);
......
...@@ -3038,8 +3038,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, ...@@ -3038,8 +3038,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
in_range(block + len - 1, ext4_inode_table(sb, gdp), in_range(block + len - 1, ext4_inode_table(sb, gdp),
EXT4_SB(sb)->s_itb_per_group)) { EXT4_SB(sb)->s_itb_per_group)) {
ext4_error(sb, __func__, ext4_error(sb, __func__,
"Allocating block in system zone - block = %llu", "Allocating block %llu in system zone of %d group\n",
block); block, ac->ac_b_ex.fe_group);
/* File system mounted not to panic on error /* File system mounted not to panic on error
* Fix the bitmap and repeat the block allocation * Fix the bitmap and repeat the block allocation
* We leak some of the blocks here. * We leak some of the blocks here.
......
...@@ -284,11 +284,9 @@ static int setup_new_group_blocks(struct super_block *sb, ...@@ -284,11 +284,9 @@ static int setup_new_group_blocks(struct super_block *sb,
if ((err = extend_or_restart_transaction(handle, 2, bh))) if ((err = extend_or_restart_transaction(handle, 2, bh)))
goto exit_bh; goto exit_bh;
mark_bitmap_end(input->blocks_count, EXT4_BLOCKS_PER_GROUP(sb), mark_bitmap_end(input->blocks_count, sb->s_blocksize * 8, bh->b_data);
bh->b_data);
ext4_handle_dirty_metadata(handle, NULL, bh); ext4_handle_dirty_metadata(handle, NULL, bh);
brelse(bh); brelse(bh);
/* Mark unused entries in inode bitmap used */ /* Mark unused entries in inode bitmap used */
ext4_debug("clear inode bitmap %#04llx (+%llu)\n", ext4_debug("clear inode bitmap %#04llx (+%llu)\n",
input->inode_bitmap, input->inode_bitmap - start); input->inode_bitmap, input->inode_bitmap - start);
...@@ -297,7 +295,7 @@ static int setup_new_group_blocks(struct super_block *sb, ...@@ -297,7 +295,7 @@ static int setup_new_group_blocks(struct super_block *sb,
goto exit_journal; goto exit_journal;
} }
mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), EXT4_BLOCKS_PER_GROUP(sb), mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), sb->s_blocksize * 8,
bh->b_data); bh->b_data);
ext4_handle_dirty_metadata(handle, NULL, bh); ext4_handle_dirty_metadata(handle, NULL, bh);
exit_bh: exit_bh:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment