From: Jan Kara
mainline inclusion
from mainline-v5.11-rc1
commit 81414b4dd48f596bf33e1b32c2e43e2047150ca6
issue: #I3ZXZF
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
-----------------------------------------------
Superblock is written out either through ext4_commit_super() or through
ext4_handle_dirty_super(). In both cases we recompute the checksum so it
is not necessary to recompute it after updating superblock free inodes &
blocks counters.
Signed-off-by: Jan Kara
Reviewed-by: Andreas Dilger
Link: https://lore.kernel.org/r/20201127113405.26867-3-jack@suse.cz
Signed-off-by: Theodore Ts'o
Signed-off-by: Ye Bin
Reviewed-by: zhangyi (F)
Signed-off-by: Chen Jun
Signed-off-by: Yu Changchun
---
fs/ext4/super.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 21c4ba2513ce..6e211dc615b3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5007,13 +5007,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
block = ext4_count_free_clusters(sb);
ext4_free_blocks_count_set(sbi->s_es,
EXT4_C2B(sbi, block));
- ext4_superblock_csum_set(sb);
err = percpu_counter_init(&sbi->s_freeclusters_counter, block,
GFP_KERNEL);
if (!err) {
unsigned long freei = ext4_count_free_inodes(sb);
sbi->s_es->s_free_inodes_count = cpu_to_le32(freei);
- ext4_superblock_csum_set(sb);
err = percpu_counter_init(&sbi->s_freeinodes_counter, freei,
GFP_KERNEL);
}
--
2.22.0