]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: update s_overhead_clusters in the superblock during an on-line resize
authorTheodore Ts'o <tytso@mit.edu>
Wed, 29 Jun 2022 04:00:25 +0000 (00:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 3 Aug 2022 03:52:19 +0000 (23:52 -0400)
commit0f47fa7905b5c0deead08ac2d4830e7bd7ed8d8b
tree9085b8cdfd5d57cb3b2096867d51bd2837fe246e
parentdec8980573d56795bd10396d0155d9f7f4d848e5
ext4: update s_overhead_clusters in the superblock during an on-line resize

When doing an online resize, the on-disk superblock on-disk wasn't
updated.  This means that when the file system is unmounted and
remounted, and the on-disk overhead value is non-zero, this would
result in the results of statfs(2) to be incorrect.

This was partially fixed by Commits 5bf43d031edc ("ext4: fix overhead
calculation to account for the reserved gdt blocks"), 0371b6196528
("ext4: force overhead calculation if the s_overhead_cluster makes no
sense"), and fdaf209c1c0f ("ext4: update the cached overhead value in
the superblock").

However, since it was too expensive to forcibly recalculate the
overhead for bigalloc file systems at every mount, this didn't fix the
problem for bigalloc file systems.  This commit should address the
problem when resizing file systems with the bigalloc feature enabled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20220629040026.112371-1-tytso@mit.edu
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/resize.c