Whamcloud - gitweb
e2fsck: Add a global latch question for bad group descriptor checksums
authorTheodore Ts'o <tytso@mit.edu>
Wed, 19 Aug 2009 05:06:50 +0000 (01:06 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 19 Aug 2009 05:06:50 +0000 (01:06 -0400)
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>
e2fsck/problem.c
e2fsck/problem.h

index fc325e9..1b09b63 100644 (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 },
 };
 
index 69dcfba..f3969e0 100644 (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