diff options
author | Theodore Ts'o <tytso@mit.edu> | 2022-06-29 00:00:26 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2022-08-02 23:52:19 -0400 |
commit | 827891a38accfb4e04dbcdefe710f8746c6ad16d (patch) | |
tree | f1bb61a29b7621879f723adbe24ea26a3a62d5ff /fs/ext4/resize.c | |
parent | de394a86658ffe4e89e5328fd4993abfe41b7435 (diff) | |
download | linux-827891a38accfb4e04dbcdefe710f8746c6ad16d.tar.gz linux-827891a38accfb4e04dbcdefe710f8746c6ad16d.tar.bz2 linux-827891a38accfb4e04dbcdefe710f8746c6ad16d.zip |
ext4: update the s_overhead_clusters in the backup sb's when resizing
When the EXT4_IOC_RESIZE_FS ioctl is complete, update the backup
superblocks. We don't do this for the old-style resize ioctls since
they are quite ancient, and only used by very old versions of
resize2fs --- and we don't want to update the backup superblocks every
time EXT4_IOC_GROUP_ADD is called, since it might get called a lot.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20220629040026.112371-2-tytso@mit.edu
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/resize.c')
-rw-r--r-- | fs/ext4/resize.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index e5c2713aa11a..e4e89ca82f8c 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -97,10 +97,13 @@ int ext4_resize_begin(struct super_block *sb) return ret; } -void ext4_resize_end(struct super_block *sb) +int ext4_resize_end(struct super_block *sb, bool update_backups) { clear_bit_unlock(EXT4_FLAGS_RESIZING, &EXT4_SB(sb)->s_ext4_flags); smp_mb__after_atomic(); + if (update_backups) + return ext4_update_overhead(sb, true); + return 0; } static ext4_group_t ext4_meta_bg_first_group(struct super_block *sb, |