Whamcloud - gitweb
libext2fs: fix alloc_allocate_group_table() if the flexbg_offset wraps
authorTheodore Ts'o <tytso@mit.edu>
Mon, 28 Apr 2014 14:03:12 +0000 (10:03 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 5 May 2014 03:15:49 +0000 (23:15 -0400)
commitd51072af0a9c458e12391be0639a129ede1d2931
tree0f7f2d900ac56e68917877764343a88b6cd88560
parent45a78b88dba1db5758f68d0d3229d3cb42da6050
libext2fs: fix alloc_allocate_group_table() if the flexbg_offset wraps

If the previous block group's inode table ends at the very end of file
system, wrap around to the beginning of the flex_bg.

This fixes a bug was tickled by:

mke2fs.conf:
frontload = {
features = extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,^resize_inode,sparse_super2
hash_alg = half_md4
num_backup_sb = 0
packed_meta_blocks = 1
inode_ratio = 4194304
flex_bg_size = 262144
}

mke2fs -T frontload /tmp/foo.img 2T
resize2fs -M /tmp/foo.img
resize2fs -M /tmp/foo.img

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