Skip to content

Commit bef53b0

Browse files
taoma-tmtytso
authored andcommitted
ext4: remove erroneous ext4_superblock_csum_set() in update_backups()
The update_backups() function is used to backup all the metadata blocks, so we should not take it for granted that 'data' is pointed to a super block and use ext4_superblock_csum_set to calculate the checksum there. In case where the data is a group descriptor block, it will corrupt the last group descriptor, and then e2fsck will complain about it it. As all the metadata checksums should already be OK when we do the backup, remove the wrong ext4_superblock_csum_set and it should be just fine. Reported-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@vger.kernel.org
1 parent 00d4e73 commit bef53b0

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

‎fs/ext4/resize.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,8 +1049,6 @@ static void update_backups(struct super_block *sb, int blk_off, char *data,
10491049
goto exit_err;
10501050
}
10511051

1052-
ext4_superblock_csum_set(sb, (struct ext4_super_block *)data);
1053-
10541052
if (meta_bg == 0) {
10551053
group = ext4_list_backups(sb, &three, &five, &seven);
10561054
last = sbi->s_groups_count;

0 commit comments

Comments
 (0)