From: Theodore Ts'o Subject: [PATCH FOR-STABLE-2.6.27 17/24] ext4: mark the blocks/inode bitmap beyond end of group as used Date: Tue, 17 Feb 2009 10:58:37 -0500 Message-ID: <1234886324-15105-18-git-send-email-tytso@mit.edu> References: <1234886324-15105-1-git-send-email-tytso@mit.edu> <1234886324-15105-2-git-send-email-tytso@mit.edu> <1234886324-15105-3-git-send-email-tytso@mit.edu> <1234886324-15105-4-git-send-email-tytso@mit.edu> <1234886324-15105-5-git-send-email-tytso@mit.edu> <1234886324-15105-6-git-send-email-tytso@mit.edu> <1234886324-15105-7-git-send-email-tytso@mit.edu> <1234886324-15105-8-git-send-email-tytso@mit.edu> <1234886324-15105-9-git-send-email-tytso@mit.edu> <1234886324-15105-10-git-send-email-tytso@mit.edu> <1234886324-15105-11-git-send-email-tytso@mit.edu> <1234886324-15105-12-git-send-email-tytso@mit.edu> <1234886324-15105-13-git-send-email-tytso@mit.edu> <1234886324-15105-14-git-send-email-tytso@mit.edu> <1234886324-15105-15-git-send-email-tytso@mit.edu> <1234886324-15105-16-git-send-email-tytso@mit.edu> <1234886324-15105-17-git-send-email-tytso@mit.edu> Cc: linux-ext4@vger.kernel.org, "Aneesh Kumar K.V" , "Theodore Ts'o" To: stable@kernel.org Return-path: Received: from thunk.org ([69.25.196.29]:35379 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbZBQQBa (ORCPT ); Tue, 17 Feb 2009 11:01:30 -0500 In-Reply-To: <1234886324-15105-17-git-send-email-tytso@mit.edu> Sender: linux-ext4-owner@vger.kernel.org List-ID: From: Aneesh Kumar K.V We need to mark the block/inode bitmap beyond the end of the group with '1'. Signed-off-by: Aneesh Kumar K.V Signed-off-by: "Theodore Ts'o" Cc: stable@kernel.org (cherry picked from commit 648f5879f5892dddd3ba71cd0d285599f40f2512) --- fs/ext4/ialloc.c | 2 +- fs/ext4/mballoc.c | 4 ++-- 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 4a3aee8..b994854 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, } 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); return EXT4_INODES_PER_GROUP(sb); diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index a7057a3..4a21c79 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3148,8 +3148,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, in_range(block + len - 1, ext4_inode_table(sb, gdp), EXT4_SB(sb)->s_itb_per_group)) { ext4_error(sb, __func__, - "Allocating block in system zone - block = %llu", - block); + "Allocating block %llu in system zone of %d group\n", + block, ac->ac_b_ex.fe_group); /* File system mounted not to panic on error * Fix the bitmap and repeat the block allocation * We leak some of the blocks here. diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index fcb911e..cfb8e36 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, if ((err = extend_or_restart_transaction(handle, 2, bh))) goto exit_bh; - mark_bitmap_end(input->blocks_count, EXT4_BLOCKS_PER_GROUP(sb), - bh->b_data); + mark_bitmap_end(input->blocks_count, sb->s_blocksize * 8, bh->b_data); ext4_journal_dirty_metadata(handle, bh); brelse(bh);