]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e2fsck: check all sparse_super backups
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 4 Sep 2023 04:57:42 +0000 (14:57 +1000)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 4 Apr 2024 14:45:56 +0000 (10:45 -0400)
commitf7ef5f3e356d9ee3e20a4c591456da1cf8184814
treeff46c296483a18d08af92f7218b75b9fda59acea
parenta192f4f344456c2390ce946b4a71db0b85ce5665
e2fsck: check all sparse_super backups

Teach e2fsck to look for backup super blocks in the "sparse_super"
groups, by checking group #1 first and then powers of 3^n, 5^n,
and 7^n, up to the limit of available block groups.

Export ext2fs_list_backups() function to efficiently iterate groups
for backup sb/GDT instead of checking every group.  Ensure that the
group counters do not try to overflow the 2^32-1 group limit, and
try to limit scanning to the size of the block device (if available).

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Link: https://lore.kernel.org/r/20230904045742.827584-1-dongyangli@ddn.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/util.c
lib/ext2fs/ext2fs.h
lib/ext2fs/res_gdt.c
tests/f_boundscheck/expect.1
tests/f_boundscheck/expect.2