Whamcloud - gitweb
LU-15002 mke2fs: try to pack the GDT blocks together 95/51295/10
authorLi Dongyang <dongyangli@ddn.com>
Tue, 13 Jun 2023 10:12:22 +0000 (04:12 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 25 Sep 2023 05:58:27 +0000 (05:58 +0000)
commit27d5daaad86a70a54e579131b55b637c7e952cf5
tree514b58ccea2b55ee84ee9dbefe571a25e0be8c45
parent03a6a831ce5d78e024c03a21f7de88b14519ef99
LU-15002 mke2fs: try to pack the GDT blocks together

Once a 4KiB block filesystem is 256TiB+ in size, the GDT grows
larger than the 128MiB size of the first block group, and would
overlap the backup superblock+GDT normally in the next group.
If this is the case, mke2fs will now automatically enable the
sparse_super2 and flex_bg features to allow the primary GDT to
spill into the second group, instead of enabling meta_bg, unless
meta_bg is explicitly requested.

Since sparse_super2 and flexbg already allow flexible placement
of the first and second backup superblock+GDT, no change is
needed to ext4 or e2fsck to use such a filesystem.

Using sparse_super2 and flexbg is preferable to meta_bg because it
packs the metadata close together at the start of the device. This
avoids millions of seeks at filesystem mount/open to read the
GDT blocks spread across a large filesystem by meta_bg.

Currently with sparse_super2 the backup superblock and GDT are put
in group #1 group and last group.  To allow the primary GDT to
spill into group #1, relocate the backups to the same group numbers
3^n, 5^n, 7^n that normal "sparse_super" backups are in.  The
first backup is close to the start of the device, while the second
backup is in a "sparse_super" group near the end of the device.

Remove the m_resize_inode_meta_bg test case, since mke2fs no
longer enables the meta_bg feature automatically.

Change-Id: I90a1d3b448fc17d4b11e8f52e41cf4ce87b89e08
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/tools/e2fsprogs/+/51295
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lib/ext2fs/initialize.c
misc/mke2fs.c
tests/m_resize_inode_meta_bg/expect.1 [deleted file]
tests/m_resize_inode_meta_bg/script [deleted file]