]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: update the bg_checksum after fixing problems in the bg descriptor
authorTheodore Ts'o <tytso@mit.edu>
Sat, 11 Dec 2021 03:40:40 +0000 (22:40 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 11 Dec 2021 03:40:40 +0000 (22:40 -0500)
Otherwise, we break the block group descriptor's checksum, and while
this gets fixed by e2fsck, it results unnecessary messages printed or
questions asked of the system administrator.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass2.c
tests/f_uninit_inode_past_unused/expect.1
tests/f_uninit_restart_fsck/expect.1
tests/f_unused_itable/expect.1

index cb80d33311bc187abe901ed5fb81013f75ed9cb2..3b473af02a43ed5ec2f65ec41cbdf1403c31fd3a 100644 (file)
@@ -1539,6 +1539,7 @@ skip_checksum:
                                        &cd->pctx)){
                                ext2fs_bg_flags_clear(fs, group,
                                                      EXT2_BG_INODE_UNINIT);
+                               ext2fs_group_desc_csum_set(fs, group);
                                ext2fs_mark_super_dirty(fs);
                                ctx->flags |= E2F_FLAG_RESTART_LATER;
                        } else {
@@ -1550,6 +1551,7 @@ skip_checksum:
                        pctx.num = dirent->inode;
                        if (fix_problem(ctx, PR_2_INOREF_IN_UNUSED, &cd->pctx)){
                                ext2fs_bg_itable_unused_set(fs, group, 0);
+                               ext2fs_group_desc_csum_set(fs, group);
                                ext2fs_mark_super_dirty(fs);
                                ctx->flags |= E2F_FLAG_RESTART_LATER;
                        } else {
index 1cf5c85cb56d0c1a43f4ad4fa8bf1826a4f52f4d..de1ac23cbf697c20a36da289145058ee4f4f109a 100644 (file)
@@ -4,9 +4,6 @@ Entry 'foo' in / (2) references inode 14 found in group 0's unused inodes area.
 Fix? yes
 
 Restarting e2fsck from the beginning...
-One or more block group descriptor checksums are invalid.  Fix? yes
-
-Group descriptor 0 checksum is 0x4c72, should be 0xde74.  FIXED.
 Pass 1: Checking inodes, blocks, and sizes
 Pass 2: Checking directory structure
 Pass 3: Checking directory connectivity
index d396beb30f120f3786acb41e7d1df3761f6c4ea7..64a2d062dc0c4d489637a285f40fe780913226d5 100644 (file)
@@ -13,10 +13,6 @@ Entry 'bar2' in /d2 (3761) has an incorrect filetype (was 1, should be 0).
 Fix? yes
 
 Restarting e2fsck from the beginning...
-One or more block group descriptor checksums are invalid.  Fix? yes
-
-Group descriptor 0 checksum is 0xb92b, should be 0x2b5f.  FIXED.
-Group descriptor 1 checksum is 0x2f53, should be 0x8d2f.  FIXED.
 Pass 1: Checking inodes, blocks, and sizes
 Pass 2: Checking directory structure
 Entry 'foo2' in /d1 (1881) has deleted/unused inode 500.  Clear? yes
index a4da987e42e5adb94cf0ae5d956716c9334205ab..ffda3c48038952e828da9d42e0bce2781f04cc11 100644 (file)
@@ -7,10 +7,6 @@ Entry '1' in / (2) references inode 12 found in group 0's unused inodes area.
 Fix? yes
 
 Restarting e2fsck from the beginning...
-One or more block group descriptor checksums are invalid.  Fix? yes
-
-Group descriptor 0 checksum is 0x289d, should be 0x788a.  FIXED.
-Group descriptor 1 checksum is 0xfaab, should be 0x3a9a.  FIXED.
 Pass 1: Checking inodes, blocks, and sizes
 Pass 2: Checking directory structure
 Pass 3: Checking directory connectivity