From ba4a021009d84682690f10e452dc81f99fe2ffdd Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 7 Jul 2008 16:11:11 -0400 Subject: [PATCH] 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" --- lib/ext2fs/alloc_tables.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c index b3da0377..8c0ecfcf 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) {