Whamcloud - gitweb
libext2fs: replace missing flexbg initialization in flexbg_offset
authorTheodore Ts'o <tytso@mit.edu>
Thu, 7 Jul 2011 17:50:49 +0000 (13:50 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 7 Jul 2011 18:20:42 +0000 (14:20 -0400)
Commit 25567a7b0fa9 accidentally removed the initialization for flexbg
and flexbg_size, which affected ext2fs_allocate_group_table() and
ext2fs_allocate_tables().   Replace them.

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

index 8b1d294..885d2b2 100644 (file)
@@ -42,6 +42,8 @@ static blk64_t flexbg_offset(ext2_filsys fs, dgrp_t group, blk64_t start_blk,
        blk64_t         last_blk, first_free = 0;
        dgrp_t          last_grp;
 
+       flexbg_size = 1 << fs->super->s_log_groups_per_flex;
+       flexbg = group / flexbg_size;
        size = rem_grp * elem_size;
 
        if (size > (int) (fs->super->s_blocks_per_group / 8))