Skip to content

Commit de394a8

Browse files
committed
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 10b01ee ("ext4: fix overhead calculation to account for the reserved gdt blocks"), 85d825d ("ext4: force overhead calculation if the s_overhead_cluster makes no sense"), and eb70542 ("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 <[email protected]> Cc: [email protected] Reviewed-by: Andreas Dilger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 5a57bca commit de394a8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ext4/resize.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,7 @@ static void ext4_update_super(struct super_block *sb,
14841484
* Update the fs overhead information
14851485
*/
14861486
ext4_calculate_overhead(sb);
1487+
es->s_overhead_clusters = cpu_to_le32(sbi->s_overhead);
14871488

14881489
if (test_opt(sb, DEBUG))
14891490
printk(KERN_DEBUG "EXT4-fs: added group %u:"

0 commit comments

Comments
 (0)