Whamcloud - gitweb
libext2fs: detect correct superblock adjustments when loading backup groups
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 11 Jan 2014 18:54:57 +0000 (13:54 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 11 Jan 2014 18:55:20 +0000 (13:55 -0500)
commit6ff02832a069bb832c8a72b949816089ae97b356
treeaab3864037c016ede5d418bb74305d9927fa62da
parent2fc92dbc59eb4a7b7f28420b97086f320271dea2
libext2fs: detect correct superblock adjustments when loading backup groups

If ext2fs_descriptor_block_loc2() is called with a meta_bg filesystem
and group_block is not the normal value, the function will return the
location of the backup group descriptor block in the next block group.
Unfortunately, it fails to account for the possibility that the backup
group contains a backup superblock but the regular superblock does
not.  This is the case with block groups 48-49 on a meta_bg fs with 1k
blocks; in this case, libext2fs will fail to open the filesystem.

Therefore, teach the function to adjust for superblocks in the backup
group, if necessary.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/openfs.c