From: Theodore Ts'o Date: Mon, 7 Jul 2008 20:11:11 +0000 (-0400) Subject: libext2fs: Fix FLEX_BG offset used by ext2fs_allocate_group_table X-Git-Tag: v1.41-WIP-0707~3 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ba4a021009d84682690f10e452dc81f99fe2ffdd;p=tools%2Fe2fsprogs.git libext2fs: Fix FLEX_BG offset used by ext2fs_allocate_group_table 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 Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c index b3da037..8c0ecfc 100644 --- a/lib/ext2fs/alloc_tables.c +++ b/lib/ext2fs/alloc_tables.c @@ -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) {