diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2009-01-05 21:46:04 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-01-05 21:46:04 -0500 |
commit | 648f5879f5892dddd3ba71cd0d285599f40f2512 (patch) | |
tree | dee22aa9be9e47c9a9a25ce38481079aaf8858c8 /fs | |
parent | 2ccb5fb9f113dae969d1ae9b6c10e80fa34f8cd3 (diff) |
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: 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')
-rw-r--r-- | fs/ext4/ialloc.c | 2 | ||||
-rw-r--r-- | fs/ext4/mballoc.c | 4 | ||||
-rw-r--r-- | fs/ext4/resize.c | 6 |
3 files changed, 5 insertions, 7 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 7b12aedc5319..e3aa3fa38608 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -84,7 +84,7 @@ unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh, | |||
84 | } | 84 | } |
85 | 85 | ||
86 | memset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8); | 86 | memset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8); |
87 | mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), EXT4_BLOCKS_PER_GROUP(sb), | 87 | mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), sb->s_blocksize * 8, |
88 | bh->b_data); | 88 | bh->b_data); |
89 | 89 | ||
90 | return EXT4_INODES_PER_GROUP(sb); | 90 | return EXT4_INODES_PER_GROUP(sb); |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 18a52d39d094..7d7f6f91d555 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -3038,8 +3038,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, | |||
3038 | in_range(block + len - 1, ext4_inode_table(sb, gdp), | 3038 | in_range(block + len - 1, ext4_inode_table(sb, gdp), |
3039 | EXT4_SB(sb)->s_itb_per_group)) { | 3039 | EXT4_SB(sb)->s_itb_per_group)) { |
3040 | ext4_error(sb, __func__, | 3040 | ext4_error(sb, __func__, |
3041 | "Allocating block in system zone - block = %llu", | 3041 | "Allocating block %llu in system zone of %d group\n", |
3042 | block); | 3042 | block, ac->ac_b_ex.fe_group); |
3043 | /* File system mounted not to panic on error | 3043 | /* File system mounted not to panic on error |
3044 | * Fix the bitmap and repeat the block allocation | 3044 | * Fix the bitmap and repeat the block allocation |
3045 | * We leak some of the blocks here. | 3045 | * We leak some of the blocks here. |
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 2d24f423fd83..c328be5d6885 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c | |||
@@ -284,11 +284,9 @@ static int setup_new_group_blocks(struct super_block *sb, | |||
284 | if ((err = extend_or_restart_transaction(handle, 2, bh))) | 284 | if ((err = extend_or_restart_transaction(handle, 2, bh))) |
285 | goto exit_bh; | 285 | goto exit_bh; |
286 | 286 | ||
287 | mark_bitmap_end(input->blocks_count, EXT4_BLOCKS_PER_GROUP(sb), | 287 | mark_bitmap_end(input->blocks_count, sb->s_blocksize * 8, bh->b_data); |
288 | bh->b_data); | ||
289 | ext4_handle_dirty_metadata(handle, NULL, bh); | 288 | ext4_handle_dirty_metadata(handle, NULL, bh); |
290 | brelse(bh); | 289 | brelse(bh); |
291 | |||
292 | /* Mark unused entries in inode bitmap used */ | 290 | /* Mark unused entries in inode bitmap used */ |
293 | ext4_debug("clear inode bitmap %#04llx (+%llu)\n", | 291 | ext4_debug("clear inode bitmap %#04llx (+%llu)\n", |
294 | input->inode_bitmap, input->inode_bitmap - start); | 292 | input->inode_bitmap, input->inode_bitmap - start); |
@@ -297,7 +295,7 @@ static int setup_new_group_blocks(struct super_block *sb, | |||
297 | goto exit_journal; | 295 | goto exit_journal; |
298 | } | 296 | } |
299 | 297 | ||
300 | mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), EXT4_BLOCKS_PER_GROUP(sb), | 298 | mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), sb->s_blocksize * 8, |
301 | bh->b_data); | 299 | bh->b_data); |
302 | ext4_handle_dirty_metadata(handle, NULL, bh); | 300 | ext4_handle_dirty_metadata(handle, NULL, bh); |
303 | exit_bh: | 301 | exit_bh: |