ext4: add correct group descriptors and reserved GDT blocks to system zone
authorWang Jianjian <wangjianjian0@foxmail.com>
Wed, 2 Aug 2023 16:28:39 +0000 (00:28 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 27 Aug 2023 15:27:12 +0000 (11:27 -0400)
commit68228da51c9a436872a4ef4b5a7692e29f7e5bc7
tree3ecc363042c80692757e7a284de16c444a0404c7
parentb6c7d6dc8aebc04cefd342d6cccd24932be37d12
ext4: add correct group descriptors and reserved GDT blocks to system zone

When setup_system_zone, flex_bg is not initialized so it is always 1.
Use a new helper function, ext4_num_base_meta_blocks() which does not
depend on sbi->s_log_groups_per_flex being initialized.

[ Squashed two patches in the Link URL's below together into a single
  commit, which is simpler to review/understand.  Also fix checkpatch
  warnings. --TYT ]

Cc: stable@kernel.org
Signed-off-by: Wang Jianjian <wangjianjian0@foxmail.com>
Link: https://lore.kernel.org/r/tencent_21AF0D446A9916ED5C51492CC6C9A0A77B05@qq.com
Link: https://lore.kernel.org/r/tencent_D744D1450CC169AEA77FCF0A64719909ED05@qq.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/balloc.c
fs/ext4/block_validity.c
fs/ext4/ext4.h