Whamcloud - gitweb
LU-15002 e2fsck: check all sparse_super backups 19/52219/2
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 1 Sep 2023 07:14:49 +0000 (01:14 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 4 Sep 2023 05:19:31 +0000 (05:19 +0000)
commiteb67ae2ec450eb7ea87d533bd24cc67340597fe6
tree435acb6da61b2a4468c3bdded0dc86e4c1ba3570
parenta59ac3441448d61d66880e2e5329585191c98716
LU-15002 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>
Change-Id: I90a1d3b448fc17d4b11e8f52e41cf4ce873ebbe5
Reviewed-on: https://review.whamcloud.com/c/tools/e2fsprogs/+/52219
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
e2fsck/util.c
lib/ext2fs/ext2fs.h
lib/ext2fs/res_gdt.c
tests/f_boundscheck/expect.1
tests/f_boundscheck/expect.2