Whamcloud - gitweb
Make ext2fs_check_desc() more stringent to force use of backup superbocks
authorTheodore Ts'o <tytso@mit.edu>
Thu, 10 Jul 2008 20:35:05 +0000 (16:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 10 Jul 2008 21:25:33 +0000 (17:25 -0400)
commit009c02baf90a55b4b2d9c9e3d0a4cfc3e2531640
treead32d830a0ad30b22fe6982e8b345b4e97de9654
parent7d56e33d1f857a44b1a9355c92914d5e7aa45cbb
Make ext2fs_check_desc() more stringent to force use of backup superbocks

E2fsck could to do more damage to a filesystem by trying to relocate
inode tables due to corrupted block group descriptors, and the
relocation could seriously damage the filesystem.

This patch enhances ext2fs_check_desk() so it detects more
self-inconsistent block group descriptors, including the cases where
e2sck might be tempted to relocate the inode table, and reports the
block group descriptors as invalid; this will cause e2fsck to attempt
to use the backup superblocks, which hopefully have not been trashed.

Addresses-Sourceforge-Bug: #1840291

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/alloc_sb.c
lib/ext2fs/check_desc.c
tests/f_resize_inode/expect