e2fsck: Add a global latch question for bad group descriptor checksums

Very often all the block group descriptors will have bad checksums, so
don't force the user answer 'yes' many, many times.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
Theodore Ts'o 2009-08-19 01:06:50 -04:00
parent 9a7fe4bdc9
commit 6013915487
2 changed files with 11 additions and 1 deletions

View File

@ -354,7 +354,7 @@ static struct e2fsck_problem problem_table[] = {
/* group descriptor N checksum is invalid. */
{ PR_0_GDT_CSUM,
N_("@g descriptor %g checksum is invalid. "),
PROMPT_FIX, PR_PREEN_OK },
PROMPT_FIX, PR_LATCH_BG_CHECKSUM },
/* group descriptor N marked uninitialized without feature set. */
{ PR_0_GDT_UNINIT,
@ -397,6 +397,11 @@ static struct e2fsck_problem problem_table[] = {
"probably due to buggy init scripts). "),
PROMPT_FIX, PR_PREEN_OK | PR_NO_OK },
/* Block group checksum (latch question) is invalid. */
{ PR_0_GDT_CSUM_LATCH,
N_("One or more @b @g descriptor checksums are invalid. "),
PROMPT_FIX, PR_PREEN_OK },
/* Pass 1 errors */
/* Pass 1: Checking inodes, blocks, and sizes */
@ -1645,6 +1650,7 @@ static struct latch_descr pr_latch_info[] = {
{ PR_LATCH_LOW_DTIME, PR_1_ORPHAN_LIST_REFUGEES, 0 },
{ PR_LATCH_TOOBIG, PR_1_INODE_TOOBIG, 0 },
{ PR_LATCH_OPTIMIZE_DIR, PR_3A_OPTIMIZE_DIR_HEADER, PR_3A_OPTIMIZE_DIR_END },
{ PR_LATCH_BG_CHECKSUM, PR_0_GDT_CSUM_LATCH, 0 },
{ -1, 0, 0 },
};

View File

@ -38,6 +38,7 @@ struct problem_context {
#define PR_LATCH_LOW_DTIME 0x0070 /* Latch for pass1 orphaned list refugees */
#define PR_LATCH_TOOBIG 0x0080 /* Latch for file to big errors */
#define PR_LATCH_OPTIMIZE_DIR 0x0090 /* Latch for optimize directories */
#define PR_LATCH_BG_CHECKSUM 0x00A0 /* Latch for block group checksums */
#define PR_LATCH(x) ((((x) & PR_LATCH_MASK) >> 4) - 1)
@ -223,6 +224,9 @@ struct problem_context {
/* Last write time is in the future (fudged) */
#define PR_0_FUTURE_SB_LAST_WRITE_FUDGED 0x00003D
/* Block group checksum (latch question) */
#define PR_0_GDT_CSUM_LATCH 0x00003E
/*
* Pass 1 errors