Whamcloud - gitweb
libext2fs: Fix FLEX_BG offset used by ext2fs_allocate_group_table
authorTheodore Ts'o <tytso@mit.edu>
Mon, 7 Jul 2008 20:11:11 +0000 (16:11 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 7 Jul 2008 20:12:28 +0000 (16:12 -0400)
The offset for both inode bitmaps and inode tables is overshot by one
block causing a hole between the group of bitmaps and inode tables
when initializing a filesystem using mke2fs.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/alloc_tables.c

index b3da037..8c0ecfc 100644 (file)
@@ -46,8 +46,11 @@ static blk_t flexbg_offset(ext2_filsys fs, dgrp_t group, blk_t start_blk,
        if (size > (int) (fs->super->s_blocks_per_group / 8))
                size = (int) fs->super->s_blocks_per_group / 8;
 
+       if (offset)
+               offset -= 1;
+
        /*
-        * Dont do a long search if the previous block
+        * Don't do a long search if the previous block
         * search is still valid.
         */
        if (start_blk && group % flexbg_size) {