Whamcloud - gitweb
Add support for the half-MD4 HTREE hash.
[tools/e2fsprogs.git] / e2fsck / problem.c
index aaaa270..7f019a7 100644 (file)
@@ -38,7 +38,8 @@
 #define PROMPT_DELETE  15
 #define PROMPT_SUPPRESS 16
 #define PROMPT_UNLINK  17
-#define PROMPT_NULL    18
+#define PROMPT_CLEAR_HTREE 18
+#define PROMPT_NULL    19
 
 /*
  * These are the prompts which are used to ask the user if they want
@@ -63,7 +64,8 @@ static const char *prompt[] = {
        N_("Delete file"),      /* 15 */
        N_("Suppress messages"),/* 16 */
        N_("Unlink"),           /* 17 */
-       "",                     /* 18 */
+       N_("Clear HTree index"),/* 18 */
+       "",                     /* 19 */
 };
 
 /*
@@ -89,6 +91,8 @@ static const char *preen_msg[] = {
        N_("FILE DELETED"),     /* 15 */
        N_("SUPPRESSED"),       /* 16 */
        N_("UNLINKED"),         /* 17 */
+       N_("HTREE INDEX CLEARED"),/* 18 */
+       "",                     /* 19 */
 };
 
 static const struct e2fsck_problem problem_table[] = {
@@ -645,6 +649,55 @@ static const struct e2fsck_problem problem_table[] = {
          N_("@a @b %b is corrupt (invalid value).  "),
          PROMPT_CLEAR, 0},
 
+       /* Inode too big (latch question) */
+       { PR_1_INODE_TOOBIG,
+         N_("@i %i is too big.  "), PROMPT_TRUNCATE, 0 },
+
+       /* Directory too big */
+       { PR_1_TOOBIG_DIR, 
+         N_("@b #%B (%b) causes @d to be too big.  "),
+         PROMPT_CLEAR, PR_LATCH_TOOBIG },
+
+       /* Regular file too big */
+       { PR_1_TOOBIG_REG,
+         N_("@b #%B (%b) causes file to be too big.  "),
+         PROMPT_CLEAR, PR_LATCH_TOOBIG },
+
+       /* Symlink too big */
+       { PR_1_TOOBIG_SYMLINK,
+         N_("@b #%B (%b) causes symlink to be too big.  "),
+         PROMPT_CLEAR, PR_LATCH_TOOBIG },
+
+       /* INDEX_FL flag set on a non-HTREE filesystem */
+       { PR_1_HTREE_SET,
+         N_("@i %i has INDEX_FL flag set on @f without htree support.\n"),
+         PROMPT_CLEAR_HTREE, 0 },
+
+       /* INDEX_FL flag set on a non-directory */      
+       { PR_1_HTREE_NODIR,
+         N_("@i %i has INDEX_FL flag set but is not a @d.\n"),
+         PROMPT_CLEAR_HTREE, 0 },
+
+       /* Invalid root node in HTREE directory */      
+       { PR_1_HTREE_BADROOT,
+         N_("@h %i has an invalid root node.\n"),
+         PROMPT_CLEAR_HTREE, 0 },
+
+       /* Unsupported hash version in HTREE directory */       
+       { PR_1_HTREE_HASHV,
+         N_("@h %i has an unsupported hash version (%N)\n"),
+         PROMPT_CLEAR_HTREE, 0 },
+
+       /* Incompatible flag in HTREE root node */      
+       { PR_1_HTREE_INCOMPAT,
+         N_("@h %i uses an incompatible htree root node flag.\n"),
+         PROMPT_CLEAR_HTREE, 0 },
+
+       /* HTREE too deep */    
+       { PR_1_HTREE_DEPTH,
+         N_("@h %i has a tree depth (%N) which is too big\n"),
+         PROMPT_CLEAR_HTREE, 0 },
+                 
        /* Pass 1b errors */
 
        /* Pass 1B: Rescan for duplicate/bad blocks */
@@ -964,6 +1017,40 @@ static const struct e2fsck_problem problem_table[] = {
          N_("@f contains large files, but lacks LARGE_FILE flag in @S.\n"),
          PROMPT_FIX, 0 },
          
+       /* Node in HTREE directory not referenced */
+       { PR_2_HTREE_NOTREF,
+         N_("@p @h %d: node (%B) not referenced\n"),
+         PROMPT_NONE, 0 },
+
+       /* Node in HTREE directory referenced twice */
+       { PR_2_HTREE_DUPREF,
+         N_("@p @h %d: node (%B) referenced twice\n"),
+         PROMPT_NONE, 0 },
+
+       /* Node in HTREE directory has bad min hash */
+       { PR_2_HTREE_MIN_HASH,
+         N_("@p @h %d: node (%B) has bad min hash\n"),
+         PROMPT_NONE, 0 },
+
+       /* Node in HTREE directory has bad max hash */
+       { PR_2_HTREE_MAX_HASH,
+         N_("@p @h %d: node (%B) has bad max hash\n"),
+         PROMPT_NONE, 0 },
+
+       /* Clear invalid HTREE directory */
+       { PR_2_HTREE_CLEAR,
+         N_("Invalid @h %d (%q).  "), PROMPT_CLEAR, 0 },
+                 
+       /* Clear the htree flag forcibly */
+       { PR_2_HTREE_FCLR,
+         N_("Forcibly clearing HTREE flag on @i %d (%q).  (Beta test code)\n"),
+                 PROMPT_NONE, 0 },
+
+       /* Bad block in htree interior node */
+       { PR_2_HTREE_BADBLK,
+         N_("@p @h %d (%q): bad @b number %B.\n"),
+         PROMPT_CLEAR_HTREE, 0 },
+
        /* Pass 3 errors */
 
        /* Pass 3: Checking directory connectivity */
@@ -1255,6 +1342,7 @@ static struct latch_descr pr_latch_info[] = {
        { PR_LATCH_RELOC, PR_0_RELOCATE_HINT, 0 },
        { PR_LATCH_DBLOCK, PR_1B_DUP_BLOCK_HEADER, PR_1B_DUP_BLOCK_END },
        { PR_LATCH_LOW_DTIME, PR_1_ORPHAN_LIST_REFUGEES, 0 },
+       { PR_LATCH_TOOBIG, PR_1_INODE_TOOBIG, 0 },
        { -1, 0, 0 },
 };