Whamcloud - gitweb
Merge branch 'maint' into next
[tools/e2fsprogs.git] / e2fsck / problem.c
index ab67cff..897693a 100644 (file)
@@ -433,6 +433,25 @@ static struct e2fsck_problem problem_table[] = {
          N_("ext2fs_check_desc: %m\n"),
          PROMPT_NONE, 0 },
 
+       /*
+        * metadata_csum implies uninit_bg; both feature bits cannot
+        * be set simultaneously.
+        */
+       { PR_0_META_AND_GDT_CSUM_SET,
+         N_("@S metadata_csum supersedes uninit_bg; both feature "
+            "bits cannot be set simultaneously."),
+         PROMPT_FIX, PR_PREEN_OK | PR_NO_OK},
+
+       /* Superblock has invalid MMP checksum. */
+       { PR_0_MMP_CSUM_INVALID,
+         N_("@S MMP block checksum does not match MMP block.  "),
+         PROMPT_FIX, PR_PREEN_OK | PR_NO_OK},
+
+       /* 64bit is set but extents is unset. */
+       { PR_0_64BIT_WITHOUT_EXTENTS,
+         N_("@S 64bit filesystems needs extents to access the whole disk.  "),
+         PROMPT_FIX, PR_PREEN_OK | PR_NO_OK},
+
        /* Pass 1 errors */
 
        /* Pass 1: Checking inodes, blocks, and sizes */
@@ -946,6 +965,46 @@ static struct e2fsck_problem problem_table[] = {
          N_("@i %i has zero length extent\n\t(@n logical @b %c, physical @b %b)\n"),
          PROMPT_CLEAR, 0 },
 
+       /* inode checksum does not match inode */
+       { PR_1_INODE_CSUM_INVALID,
+         N_("@i %i checksum does not match @i.  "),
+         PROMPT_CLEAR, PR_PREEN_OK },
+
+       /* inode passes checks, but checksum does not match inode */
+       { PR_1_INODE_ONLY_CSUM_INVALID,
+         N_("@i %i passes checks, but checksum does not match @i.  "),
+         PROMPT_FIX, PR_PREEN_OK },
+
+       /* Inode extent block checksum does not match extent */
+       { PR_1_EXTENT_CSUM_INVALID,
+         N_("@i %i extent block checksum does not match extent\n\t(logical @b "
+            "%c, @n physical @b %b, len %N)\n"),
+         PROMPT_CLEAR, 0 },
+
+       /*
+        * Inode extent block passes checks, but checksum does not match
+        * extent
+        */
+       { PR_1_EXTENT_ONLY_CSUM_INVALID,
+         N_("@i %i extent block passes checks, but checksum does not match "
+            "extent\n\t(logical @b %c, @n physical @b %b, len %N)\n"),
+         PROMPT_FIX, 0 },
+
+       /* Extended attribute block checksum for inode does not match. */
+       { PR_1_EA_BLOCK_CSUM_INVALID,
+         N_("Extended attribute @a @b %b checksum for @i %i does not "
+            "match.  "),
+         PROMPT_CLEAR, 0 },
+
+       /*
+        * Extended attribute block passes checks, but checksum for inode does
+        * not match.
+        */
+       { PR_1_EA_BLOCK_ONLY_CSUM_INVALID,
+         N_("Extended attribute @a @b %b passes checks, but checksum for "
+            "@i %i does not match.  "),
+         PROMPT_FIX, 0 },
+
        /*
         * Interior extent node logical offset doesn't match first node below it
         */
@@ -954,6 +1013,12 @@ static struct e2fsck_problem problem_table[] = {
             "Logical start %b does not match logical start %c at next level.  "),
          PROMPT_FIX, 0 },
 
+       /* Extent end is out of bounds for the tree */
+       { PR_1_EXTENT_END_OUT_OF_BOUNDS,
+         N_("@i %i, end of extent exceeds allowed value\n\t(logical @b %c, physical @b %b, len %N)\n"),
+         PROMPT_CLEAR, 0 },
+
+
        /* Pass 1b errors */
 
        /* Pass 1B: Rescan for duplicate/bad blocks */
@@ -1376,6 +1441,31 @@ static struct e2fsck_problem problem_table[] = {
          N_("i_file_acl_hi @F %N, @s zero.\n"),
          PROMPT_CLEAR, PR_PREEN_OK },
 
+       /* htree root node fails checksum */
+       { PR_2_HTREE_ROOT_CSUM_INVALID,
+         N_("@p @h %d: root node fails checksum\n"),
+         PROMPT_CLEAR_HTREE, PR_PREEN_OK },
+
+       /* htree internal node fails checksum */
+       { PR_2_HTREE_NODE_CSUM_INVALID,
+         N_("@p @h %d: internal node fails checksum\n"),
+         PROMPT_CLEAR_HTREE, PR_PREEN_OK },
+
+       /* leaf node fails checksum */
+       { PR_2_LEAF_NODE_CSUM_INVALID,
+         N_("@d @i %i, %B, offset %N: @d fails checksum\n"),
+         PROMPT_SALVAGE, PR_PREEN_OK },
+
+       /* leaf node has no checksum */
+       { PR_2_LEAF_NODE_MISSING_CSUM,
+         N_("@d @i %i, %B, offset %N: @d has no checksum\n"),
+         PROMPT_FIX, PR_PREEN_OK },
+
+       /* leaf node passes checks but fails checksum */
+       { PR_2_LEAF_NODE_ONLY_CSUM_INVALID,
+         N_("@d @i %i, %B, offset %N: @d passes checks but fails checksum\n"),
+         PROMPT_FIX, PR_PREEN_OK },
+
        /* Pass 3 errors */
 
        /* Pass 3: Checking directory connectivity */
@@ -1692,6 +1782,16 @@ static struct e2fsck_problem problem_table[] = {
          N_("@g %g @i(s) in use but @g is marked INODE_UNINIT\n"),
          PROMPT_FIX, PR_PREEN_OK },
 
+       /* Group N inode bitmap does not match checksum */
+       { PR_5_INODE_BITMAP_CSUM_INVALID,
+         N_("@g %g @i bitmap does not match checksum\n"),
+         PROMPT_FIX, PR_LATCH_IBITMAP | PR_PREEN_OK },
+
+       /* Group N block bitmap does not match checksum */
+       { PR_5_BLOCK_BITMAP_CSUM_INVALID,
+         N_("@g %g @b bitmap does not match checksum\n"),
+         PROMPT_FIX, PR_LATCH_BBITMAP | PR_PREEN_OK },
+
        /* Post-Pass 5 errors */
 
        /* Recreate journal if E2F_FLAG_JOURNAL_INODE flag is set */
@@ -1824,7 +1924,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
                return 0;
        }
        if (!(ptr->flags & PR_CONFIG)) {
-               char    key[9], *new_desc;
+               char    key[9], *new_desc = NULL;
 
                sprintf(key, "0x%06x", code);