Whamcloud - gitweb
libext2fs: fix regression in ext2fs_new_block2() for uninit_bg file systems
authorTheodore Ts'o <tytso@mit.edu>
Thu, 16 Jun 2011 02:11:59 +0000 (22:11 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 16 Jun 2011 02:11:59 +0000 (22:11 -0400)
Commit b0ecb787ef introduced a bug in check_block_uninit(), which is
used by ext2fs_new_block2().  This bug resulted in the block bitmap
for the block group in question not having space reserved for the file
system metadata blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/alloc.c

index fbecdbe..d96b2aa 100644 (file)
@@ -55,6 +55,8 @@ static void check_block_uninit(ext2_filsys fs, ext2fs_block_bitmap map,
        for (i=0; i < fs->super->s_blocks_per_group; i++, blk++)
                ext2fs_fast_unmark_block_bitmap2(map, blk);
 
+       blk = (group * fs->super->s_blocks_per_group) +
+               fs->super->s_first_data_block;
        for (i=0; i < fs->super->s_blocks_per_group; i++, blk++) {
                if ((blk == super_blk) ||
                    (old_desc_blk && old_desc_blocks &&