Patch "ext4: update s_overhead_clusters in the superblock during an on-line resize" has been added to the 5.18-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ext4: update s_overhead_clusters in the superblock during an on-line resize

to the 5.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ext4-update-s_overhead_clusters-in-the-superblock-du.patch
and it can be found in the queue-5.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 17944868e9c621e876595423dbbf4c4660b651fd
Author: Theodore Ts'o <tytso@xxxxxxx>
Date:   Wed Jun 29 00:00:25 2022 -0400

    ext4: update s_overhead_clusters in the superblock during an on-line resize
    
    [ Upstream commit de394a86658ffe4e89e5328fd4993abfe41b7435 ]
    
    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 10b01ee92df5 ("ext4: fix overhead
    calculation to account for the reserved gdt blocks"), 85d825dbf489
    ("ext4: force overhead calculation if the s_overhead_cluster makes no
    sense"), and eb7054212eac ("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@xxxxxxx>
    Cc: stable@xxxxxxxxxx
    Reviewed-by: Andreas Dilger <adilger@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220629040026.112371-1-tytso@xxxxxxx
    Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 8b70a4701293..e5c2713aa11a 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1484,6 +1484,7 @@ static void ext4_update_super(struct super_block *sb,
 	 * Update the fs overhead information
 	 */
 	ext4_calculate_overhead(sb);
+	es->s_overhead_clusters = cpu_to_le32(sbi->s_overhead);
 
 	if (test_opt(sb, DEBUG))
 		printk(KERN_DEBUG "EXT4-fs: added group %u:"



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux