Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 1 | /* |
| 2 | * problem.h --- e2fsck problem error codes |
| 3 | * |
| 4 | * Copyright 1996 by Theodore Ts'o |
| 5 | * |
| 6 | * %Begin-Header% |
| 7 | * This file may be redistributed under the terms of the GNU Public |
| 8 | * License. |
| 9 | * %End-Header% |
| 10 | */ |
| 11 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 12 | typedef __u32 problem_t; |
| 13 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 14 | struct problem_context { |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 15 | errcode_t errcode; |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 16 | ino_t ino, ino2, dir; |
| 17 | struct ext2_inode *inode; |
| 18 | struct ext2_dir_entry *dirent; |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 19 | blk_t blk, blk2; |
Theodore Ts'o | 246501c | 1998-03-24 16:22:38 +0000 | [diff] [blame^] | 20 | blkcnt_t blkcount; |
| 21 | int group; |
| 22 | __u64 num; |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 23 | const char *str; |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 24 | }; |
| 25 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 26 | /* |
| 27 | * We define a set of "latch groups"; these are problems which are |
| 28 | * handled as a set. The user answers once for a particular latch |
| 29 | * group. |
| 30 | */ |
| 31 | #define PR_LATCH_MASK 0x0070 /* Latch mask */ |
| 32 | #define PR_LATCH_BLOCK 0x0010 /* Latch for illegal blocks (pass 1) */ |
| 33 | #define PR_LATCH_BBLOCK 0x0020 /* Latch for bad block inode blocks (pass 1) */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 34 | #define PR_LATCH_IBITMAP 0x0030 /* Latch for pass 5 inode bitmap proc. */ |
| 35 | #define PR_LATCH_BBITMAP 0x0040 /* Latch for pass 5 inode bitmap proc. */ |
| 36 | #define PR_LATCH_RELOC 0x0050 /* Latch for superblock relocate hint */ |
| 37 | #define PR_LATCH_DBLOCK 0x0060 /* Latch for pass 1b dup block headers */ |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 38 | |
| 39 | #define PR_LATCH(x) ((((x) & PR_LATCH_MASK) >> 4) - 1) |
| 40 | |
| 41 | /* |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 42 | * Latch group descriptor flags |
| 43 | */ |
| 44 | #define PRL_YES 0x0001 /* Answer yes */ |
| 45 | #define PRL_NO 0x0002 /* Answer no */ |
| 46 | #define PRL_LATCHED 0x0004 /* The latch group is latched */ |
| 47 | #define PRL_SUPPRESS 0x0008 /* Suppress all latch group questions */ |
| 48 | |
| 49 | #define PRL_VARIABLE 0x000f /* All the flags that need to be reset */ |
| 50 | |
| 51 | /* |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 52 | * Pre-Pass 1 errors |
| 53 | */ |
| 54 | |
| 55 | /* Block bitmap not in group */ |
| 56 | #define PR_0_BB_NOT_GROUP 0x000001 |
| 57 | |
| 58 | /* Inode bitmap not in group */ |
| 59 | #define PR_0_IB_NOT_GROUP 0x000002 |
| 60 | |
| 61 | /* Inode table not in group */ |
| 62 | #define PR_0_ITABLE_NOT_GROUP 0x000003 |
| 63 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 64 | /* Superblock corrupt */ |
| 65 | #define PR_0_SB_CORRUPT 0x000004 |
| 66 | |
| 67 | /* Filesystem size is wrong */ |
| 68 | #define PR_0_FS_SIZE_WRONG 0x000005 |
| 69 | |
| 70 | /* Fragments not supported */ |
| 71 | #define PR_0_NO_FRAGMENTS 0x000006 |
| 72 | |
| 73 | /* Bad blocks_per_group */ |
| 74 | #define PR_0_BLOCKS_PER_GROUP 0x000007 |
| 75 | |
| 76 | /* Bad first_data_block */ |
| 77 | #define PR_0_FIRST_DATA_BLOCK 0x000008 |
| 78 | |
| 79 | /* Adding UUID to filesystem */ |
| 80 | #define PR_0_ADD_UUID 0x000009 |
| 81 | |
| 82 | /* Relocate hint */ |
| 83 | #define PR_0_RELOCATE_HINT 0x00000A |
| 84 | |
| 85 | /* Miscellaneous superblock corruption */ |
| 86 | #define PR_0_MISC_CORRUPT_SUPER 0x00000B |
| 87 | |
| 88 | /* Error determing physical device size of filesystem */ |
| 89 | #define PR_0_GETSIZE_ERROR 0x00000C |
| 90 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 91 | /* |
| 92 | * Pass 1 errors |
| 93 | */ |
| 94 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 95 | /* Pass 1: Checking inodes, blocks, and sizes */ |
| 96 | #define PR_1_PASS_HEADER 0x010000 |
| 97 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 98 | /* Root directory is not an inode */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 99 | #define PR_1_ROOT_NO_DIR 0x010001 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 100 | |
| 101 | /* Root directory has dtime set */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 102 | #define PR_1_ROOT_DTIME 0x010002 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 103 | |
| 104 | /* Reserved inode has bad mode */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 105 | #define PR_1_RESERVED_BAD_MODE 0x010003 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 106 | |
| 107 | /* Deleted inode has zero dtime */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 108 | #define PR_1_ZERO_DTIME 0x010004 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 109 | |
| 110 | /* Inode in use, but dtime set */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 111 | #define PR_1_SET_DTIME 0x010005 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 112 | |
| 113 | /* Zero-length directory */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 114 | #define PR_1_ZERO_LENGTH_DIR 0x010006 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 115 | |
| 116 | /* Block bitmap conflicts with some other fs block */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 117 | #define PR_1_BB_CONFLICT 0x010007 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 118 | |
| 119 | /* Inode bitmap conflicts with some other fs block */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 120 | #define PR_1_IB_CONFLICT 0x010008 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 121 | |
| 122 | /* Inode table conflicts with some other fs block */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 123 | #define PR_1_ITABLE_CONFLICT 0x010009 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 124 | |
| 125 | /* Block bitmap is on a bad block */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 126 | #define PR_1_BB_BAD_BLOCK 0x01000A |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 127 | |
| 128 | /* Inode bitmap is on a bad block */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 129 | #define PR_1_IB_BAD_BLOCK 0x01000B |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 130 | |
| 131 | /* Inode has incorrect i_size */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 132 | #define PR_1_BAD_I_SIZE 0x01000C |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 133 | |
| 134 | /* Inode has incorrect i_blocks */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 135 | #define PR_1_BAD_I_BLOCKS 0x01000D |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 136 | |
| 137 | /* Illegal block number in inode */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 138 | #define PR_1_ILLEGAL_BLOCK_NUM 0x01000E |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 139 | |
| 140 | /* Block number overlaps fs metadata */ |
| 141 | #define PR_1_BLOCK_OVERLAPS_METADATA 0x01000F |
| 142 | |
| 143 | /* Inode has illegal blocks (latch question) */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 144 | #define PR_1_INODE_BLOCK_LATCH 0x010010 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 145 | |
| 146 | /* Too many bad blocks in inode */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 147 | #define PR_1_TOO_MANY_BAD_BLOCKS 0x010011 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 148 | |
| 149 | /* Illegal block number in bad block inode */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 150 | #define PR_1_BB_ILLEGAL_BLOCK_NUM 0x010012 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 151 | |
| 152 | /* Bad block inode has illegal blocks (latch question) */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 153 | #define PR_1_INODE_BBLOCK_LATCH 0x010013 |
| 154 | |
| 155 | /* Duplicate or bad blocks in use! */ |
| 156 | #define PR_1_DUP_BLOCKS_PREENSTOP 0x010014 |
| 157 | |
| 158 | /* Bad block used as bad block indirect block */ |
| 159 | #define PR_1_BBINODE_BAD_METABLOCK 0x010015 |
| 160 | |
| 161 | /* Inconsistency can't be fixed prompt */ |
| 162 | #define PR_1_BBINODE_BAD_METABLOCK_PROMPT 0x010016 |
| 163 | |
| 164 | /* Bad primary block */ |
| 165 | #define PR_1_BAD_PRIMARY_BLOCK 0x0100017 |
| 166 | |
| 167 | /* Bad primary block prompt */ |
| 168 | #define PR_1_BAD_PRIMARY_BLOCK_PROMPT 0x0100018 |
| 169 | |
| 170 | /* Bad primary superblock */ |
| 171 | #define PR_1_BAD_PRIMARY_SUPERBLOCK 0x0100019 |
| 172 | |
| 173 | /* Bad primary block group descriptors */ |
| 174 | #define PR_1_BAD_PRIMARY_GROUP_DESCRIPTOR 0x010001A |
| 175 | |
| 176 | /* Bad superblock in group */ |
| 177 | #define PR_1_BAD_SUPERBLOCK 0x010001B |
| 178 | |
| 179 | /* Bad block group descriptors in group */ |
| 180 | #define PR_1_BAD_GROUP_DESCRIPTORS 0x010001C |
| 181 | |
| 182 | /* Block claimed for no reason */ |
| 183 | #define PR_1_PROGERR_CLAIMED_BLOCK 0x010001D |
| 184 | |
Theodore Ts'o | f8188ff | 1997-11-14 05:23:04 +0000 | [diff] [blame] | 185 | /* Error allocating blocks for relocating metadata */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 186 | #define PR_1_RELOC_BLOCK_ALLOCATE 0x010001E |
| 187 | |
Theodore Ts'o | f8188ff | 1997-11-14 05:23:04 +0000 | [diff] [blame] | 188 | /* Error allocating block buffer during relocation process */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 189 | #define PR_1_RELOC_MEMORY_ALLOCATE 0x010001F |
| 190 | |
| 191 | /* Relocating metadata group information from X to Y */ |
| 192 | #define PR_1_RELOC_FROM_TO 0x0100020 |
| 193 | |
| 194 | /* Relocating metatdata group information to X */ |
| 195 | #define PR_1_RELOC_TO 0x0100021 |
| 196 | |
| 197 | /* Block read error during relocation process */ |
| 198 | #define PR_1_RELOC_READ_ERR 0x0100022 |
| 199 | |
| 200 | /* Block write error during relocation process */ |
| 201 | #define PR_1_RELOC_WRITE_ERR 0x0100023 |
| 202 | |
| 203 | /* Error allocating inode bitmap */ |
| 204 | #define PR_1_ALLOCATE_IBITMAP_ERROR 0x0100024 |
| 205 | |
| 206 | /* Error allocating block bitmap */ |
| 207 | #define PR_1_ALLOCATE_BBITMAP_ERROR 0x0100025 |
| 208 | |
| 209 | /* Error allocating icount structure */ |
| 210 | #define PR_1_ALLOCATE_ICOUNT 0x0100026 |
| 211 | |
| 212 | /* Error allocating dbcount */ |
| 213 | #define PR_1_ALLOCATE_DBCOUNT 0x0100027 |
| 214 | |
| 215 | /* Error while scanning inodes */ |
| 216 | #define PR_1_ISCAN_ERROR 0x0100028 |
| 217 | |
| 218 | /* Error while iterating over blocks */ |
| 219 | #define PR_1_BLOCK_ITERATE 0x0100029 |
| 220 | |
| 221 | /* Error while storing inode count information */ |
| 222 | #define PR_1_ICOUNT_STORE 0x010002A |
| 223 | |
| 224 | /* Error while storing directory block information */ |
| 225 | #define PR_1_ADD_DBLOCK 0x010002B |
| 226 | |
| 227 | /* Error while reading inode (for clearing) */ |
| 228 | #define PR_1_READ_INODE 0x010002C |
| 229 | |
Theodore Ts'o | f8188ff | 1997-11-14 05:23:04 +0000 | [diff] [blame] | 230 | /* Suppress messages prompt */ |
| 231 | #define PR_1_SUPPRESS_MESSAGES 0x010002D |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 232 | |
Theodore Ts'o | 246501c | 1998-03-24 16:22:38 +0000 | [diff] [blame^] | 233 | /* Filesystem contains large files, but has no such flag in sb */ |
| 234 | #define PR_1_FEATURE_LARGE_FILES 0x01002E |
| 235 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 236 | /* |
| 237 | * Pass 1b errors |
| 238 | */ |
| 239 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 240 | /* Pass 1B: Rescan for duplicate/bad blocks */ |
| 241 | #define PR_1B_PASS_HEADER 0x011000 |
| 242 | |
| 243 | /* Duplicate/bad block(s) header */ |
| 244 | #define PR_1B_DUP_BLOCK_HEADER 0x011001 |
| 245 | |
| 246 | /* Duplicate/bad block(s) in inode */ |
| 247 | #define PR_1B_DUP_BLOCK 0x011002 |
| 248 | |
| 249 | /* Duplicate/bad block(s) end */ |
| 250 | #define PR_1B_DUP_BLOCK_END 0x011003 |
| 251 | |
| 252 | /* Error while scanning inodes */ |
| 253 | #define PR_1B_ISCAN_ERROR 0x011004 |
| 254 | |
| 255 | /* Error allocating inode bitmap */ |
| 256 | #define PR_1B_ALLOCATE_IBITMAP_ERROR 0x011005 |
| 257 | |
| 258 | |
| 259 | /* Pass 1C: Scan directories for inodes with dup blocks. */ |
| 260 | #define PR_1C_PASS_HEADER 0x012000 |
| 261 | |
| 262 | |
| 263 | /* Pass 1D: Reconciling duplicate blocks */ |
| 264 | #define PR_1D_PASS_HEADER 0x013000 |
| 265 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 266 | /* File has duplicate blocks */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 267 | #define PR_1D_DUP_FILE 0x013001 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 268 | |
| 269 | /* List of files sharing duplicate blocks */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 270 | #define PR_1D_DUP_FILE_LIST 0x013002 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 271 | |
Theodore Ts'o | 521e368 | 1997-04-29 17:48:10 +0000 | [diff] [blame] | 272 | /* File sharing blocks with filesystem metadata */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 273 | #define PR_1D_SHARE_METADATA 0x013003 |
Theodore Ts'o | 521e368 | 1997-04-29 17:48:10 +0000 | [diff] [blame] | 274 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 275 | /* Report of how many duplicate/bad inodes */ |
| 276 | #define PR_1D_NUM_DUP_INODES 0x013004 |
| 277 | |
| 278 | /* Duplicated blocks already reassigned or cloned. */ |
| 279 | #define PR_1D_DUP_BLOCKS_DEALT 0x013005 |
| 280 | |
| 281 | /* Clone duplicate/bad blocks? */ |
| 282 | #define PR_1D_CLONE_QUESTION 0x013006 |
| 283 | |
| 284 | /* Delete file? */ |
| 285 | #define PR_1D_DELETE_QUESTION 0x013007 |
| 286 | |
| 287 | /* Couldn't clone file (error) */ |
| 288 | #define PR_1D_CLONE_ERROR 0x013008 |
| 289 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 290 | /* |
| 291 | * Pass 2 errors |
| 292 | */ |
| 293 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 294 | /* Pass 2: Checking directory structure */ |
| 295 | #define PR_2_PASS_HEADER 0x020000 |
| 296 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 297 | /* Bad inode number for '.' */ |
| 298 | #define PR_2_BAD_INODE_DOT 0x020001 |
| 299 | |
| 300 | /* Directory entry has bad inode number */ |
| 301 | #define PR_2_BAD_INO 0x020002 |
| 302 | |
| 303 | /* Directory entry has deleted or unused inode */ |
| 304 | #define PR_2_UNUSED_INODE 0x020003 |
| 305 | |
| 306 | /* Directry entry is link to '.' */ |
| 307 | #define PR_2_LINK_DOT 0x020004 |
| 308 | |
| 309 | /* Directory entry points to inode now located in a bad block */ |
| 310 | #define PR_2_BB_INODE 0x020005 |
| 311 | |
| 312 | /* Directory entry contains a link to a directory */ |
| 313 | #define PR_2_LINK_DIR 0x020006 |
| 314 | |
| 315 | /* Directory entry contains a link to the root directry */ |
| 316 | #define PR_2_LINK_ROOT 0x020007 |
| 317 | |
| 318 | /* Directory entry has illegal characters in its name */ |
| 319 | #define PR_2_BAD_NAME 0x020008 |
| 320 | |
| 321 | /* Missing '.' in directory inode */ |
| 322 | #define PR_2_MISSING_DOT 0x020009 |
| 323 | |
| 324 | /* Missing '..' in directory inode */ |
| 325 | #define PR_2_MISSING_DOT_DOT 0x02000A |
| 326 | |
| 327 | /* First entry in directory inode doesn't contain '.' */ |
| 328 | #define PR_2_1ST_NOT_DOT 0x02000B |
| 329 | |
| 330 | /* Second entry in directory inode doesn't contain '..' */ |
| 331 | #define PR_2_2ND_NOT_DOT_DOT 0x02000C |
| 332 | |
| 333 | /* i_faddr should be zero */ |
| 334 | #define PR_2_FADDR_ZERO 0x02000D |
| 335 | |
| 336 | /* i_file_acl should be zero */ |
| 337 | #define PR_2_FILE_ACL_ZERO 0x02000E |
| 338 | |
| 339 | /* i_dir_acl should be zero */ |
| 340 | #define PR_2_DIR_ACL_ZERO 0x02000F |
| 341 | |
| 342 | /* i_frag should be zero */ |
| 343 | #define PR_2_FRAG_ZERO 0x020010 |
| 344 | |
| 345 | /* i_fsize should be zero */ |
| 346 | #define PR_2_FSIZE_ZERO 0x020011 |
| 347 | |
| 348 | /* inode has bad mode */ |
| 349 | #define PR_2_BAD_MODE 0x020012 |
| 350 | |
| 351 | /* directory corrupted */ |
| 352 | #define PR_2_DIR_CORRUPTED 0x020013 |
| 353 | |
| 354 | /* filename too long */ |
| 355 | #define PR_2_FILENAME_LONG 0x020014 |
| 356 | |
| 357 | /* Directory inode has a missing block (hole) */ |
| 358 | #define PR_2_DIRECTORY_HOLE 0x020015 |
| 359 | |
| 360 | /* '.' is not NULL terminated */ |
| 361 | #define PR_2_DOT_NULL_TERM 0x020016 |
| 362 | |
| 363 | /* '..' is not NULL terminated */ |
| 364 | #define PR_2_DOT_DOT_NULL_TERM 0x020017 |
| 365 | |
Theodore Ts'o | 7cf73dc | 1997-08-14 17:17:16 +0000 | [diff] [blame] | 366 | /* Illegal character device in inode */ |
| 367 | #define PR_2_BAD_CHAR_DEV 0x020018 |
| 368 | |
| 369 | /* Illegal block device in inode */ |
| 370 | #define PR_2_BAD_BLOCK_DEV 0x020019 |
| 371 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 372 | /* Duplicate '.' entry */ |
| 373 | #define PR_2_DUP_DOT 0x02001A |
| 374 | |
| 375 | /* Duplicate '..' entry */ |
| 376 | #define PR_2_DUP_DOT_DOT 0x02001B |
| 377 | |
| 378 | /* Internal error: couldn't find dir_info */ |
| 379 | #define PR_2_NO_DIRINFO 0x02001C |
| 380 | |
| 381 | /* Final rec_len is wrong */ |
| 382 | #define PR_2_FINAL_RECLEN 0x02001D |
| 383 | |
| 384 | /* Error allocating icount structure */ |
| 385 | #define PR_2_ALLOCATE_ICOUNT 0x02001E |
| 386 | |
| 387 | /* Error iterating over directory blocks */ |
| 388 | #define PR_2_DBLIST_ITERATE 0x02001F |
| 389 | |
| 390 | /* Error reading directory block */ |
| 391 | #define PR_2_READ_DIRBLOCK 0x020020 |
| 392 | |
| 393 | /* Error writing directory block */ |
| 394 | #define PR_2_WRITE_DIRBLOCK 0x020021 |
| 395 | |
| 396 | /* Error allocating new directory block */ |
| 397 | #define PR_2_ALLOC_DIRBOCK 0x020022 |
| 398 | |
| 399 | /* Error deallocating inode */ |
| 400 | #define PR_2_DEALLOC_INODE 0x020023 |
| 401 | |
Theodore Ts'o | f8188ff | 1997-11-14 05:23:04 +0000 | [diff] [blame] | 402 | /* Directory entry for '.' is big. Split? */ |
| 403 | #define PR_2_SPLIT_DOT 0x0200024 |
| 404 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 405 | /* |
| 406 | * Pass 3 errors |
| 407 | */ |
| 408 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 409 | /* Pass 3: Checking directory connectivity */ |
| 410 | #define PR_3_PASS_HEADER 0x030000 |
| 411 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 412 | /* Root inode not allocated */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 413 | #define PR_3_NO_ROOT_INODE 0x030001 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 414 | |
| 415 | /* No room in lost+found */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 416 | #define PR_3_EXPAND_LF_DIR 0x030002 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 417 | |
| 418 | /* Unconnected directory inode */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 419 | #define PR_3_UNCONNECTED_DIR 0x030003 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 420 | |
| 421 | /* /lost+found not found */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 422 | #define PR_3_NO_LF_DIR 0x030004 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 423 | |
| 424 | /* .. entry is incorrect */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 425 | #define PR_3_BAD_DOT_DOT 0x030005 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 426 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 427 | /* Bad or non-existent /lost+found. Cannot reconnect */ |
| 428 | #define PR_3_NO_LPF 0x030006 |
| 429 | |
| 430 | /* Could not expand /lost+found */ |
| 431 | #define PR_3_CANT_EXPAND_LPF 0x030007 |
| 432 | |
| 433 | /* Could not reconnect inode */ |
| 434 | #define PR_3_CANT_RECONNECT 0x030008 |
| 435 | |
| 436 | /* Error while trying to find /lost+found */ |
| 437 | #define PR_3_ERR_FIND_LPF 0x030009 |
| 438 | |
| 439 | /* Error in ext2fs_new_block while creating /lost+found */ |
| 440 | #define PR_3_ERR_LPF_NEW_BLOCK 0x03000A |
| 441 | |
| 442 | /* Error in ext2fs_new_inode while creating /lost+found */ |
| 443 | #define PR_3_ERR_LPF_NEW_INODE 0x03000B |
| 444 | |
| 445 | /* Error in ext2fs_new_dir_block while creating /lost+found */ |
| 446 | #define PR_3_ERR_LPF_NEW_DIR_BLOCK 0x03000C |
| 447 | |
| 448 | /* Error while writing directory block for /lost+found */ |
| 449 | #define PR_3_ERR_LPF_WRITE_BLOCK 0x03000D |
| 450 | |
| 451 | /* Error while adjusting inode count */ |
| 452 | #define PR_3_ADJUST_INODE 0x03000E |
| 453 | |
| 454 | /* Couldn't fix parent directory -- error */ |
| 455 | #define PR_3_FIX_PARENT_ERR 0x03000F |
| 456 | |
| 457 | /* Couldn't fix parent directory -- couldn't find it */ |
| 458 | #define PR_3_FIX_PARENT_NOFIND 0x030010 |
| 459 | |
| 460 | /* Error allocating inode bitmap */ |
| 461 | #define PR_3_ALLOCATE_IBITMAP_ERROR 0x030011 |
| 462 | |
| 463 | /* Error creating root directory */ |
| 464 | #define PR_3_CREATE_ROOT_ERROR 0x030012 |
| 465 | |
| 466 | /* Error creating lost and found directory */ |
| 467 | #define PR_3_CREATE_LPF_ERROR 0x030013 |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 468 | |
Theodore Ts'o | f8188ff | 1997-11-14 05:23:04 +0000 | [diff] [blame] | 469 | /* Root inode is not directory; aborting */ |
| 470 | #define PR_3_ROOT_NOT_DIR_ABORT 0x030014 |
| 471 | |
| 472 | /* Cannot proceed without a root inode. */ |
| 473 | #define PR_3_NO_ROOT_INODE_ABORT 0x030015 |
| 474 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 475 | /* |
| 476 | * Pass 4 errors |
| 477 | */ |
| 478 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 479 | /* Pass 4: Checking reference counts */ |
| 480 | #define PR_4_PASS_HEADER 0x040000 |
| 481 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 482 | /* Unattached zero-length inode */ |
| 483 | #define PR_4_ZERO_LEN_INODE 0x040001 |
| 484 | |
| 485 | /* Unattached inode */ |
| 486 | #define PR_4_UNATTACHED_INODE 0x040002 |
| 487 | |
| 488 | /* Inode ref count wrong */ |
| 489 | #define PR_4_BAD_REF_COUNT 0x040003 |
| 490 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 491 | /* Inconsistent inode count information cached */ |
| 492 | #define PR_4_INCONSISTENT_COUNT 0x040004 |
| 493 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 494 | /* |
| 495 | * Pass 5 errors |
| 496 | */ |
| 497 | |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 498 | /* Pass 5: Checking group summary information */ |
| 499 | #define PR_5_PASS_HEADER 0x050000 |
| 500 | |
| 501 | /* Padding at end of inode bitmap is not set. */ |
| 502 | #define PR_5_INODE_BMAP_PADDING 0x050001 |
| 503 | |
| 504 | /* Padding at end of block bitmap is not set. */ |
| 505 | #define PR_5_BLOCK_BMAP_PADDING 0x050002 |
| 506 | |
| 507 | /* Block bitmap differences header */ |
| 508 | #define PR_5_BLOCK_BITMAP_HEADER 0x050003 |
| 509 | |
| 510 | /* Block not used, but marked in bitmap */ |
| 511 | #define PR_5_UNUSED_BLOCK 0x050004 |
| 512 | |
| 513 | /* Block used, but not marked used in bitmap */ |
| 514 | #define PR_5_BLOCK_USED 0x050005 |
| 515 | |
| 516 | /* Block bitmap differences end */ |
| 517 | #define PR_5_BLOCK_BITMAP_END 0x050006 |
| 518 | |
| 519 | /* Inode bitmap differences header */ |
| 520 | #define PR_5_INODE_BITMAP_HEADER 0x050007 |
| 521 | |
| 522 | /* Inode not used, but marked in bitmap */ |
| 523 | #define PR_5_UNUSED_INODE 0x050008 |
| 524 | |
| 525 | /* Inode used, but not marked used in bitmap */ |
| 526 | #define PR_5_INODE_USED 0x050009 |
| 527 | |
| 528 | /* Inode bitmap differences end */ |
| 529 | #define PR_5_INODE_BITMAP_END 0x05000A |
| 530 | |
| 531 | /* Free inodes count for group wrong */ |
| 532 | #define PR_5_FREE_INODE_COUNT_GROUP 0x05000B |
| 533 | |
| 534 | /* Directories count for group wrong */ |
| 535 | #define PR_5_FREE_DIR_COUNT_GROUP 0x05000C |
| 536 | |
| 537 | /* Free inodes count wrong */ |
| 538 | #define PR_5_FREE_INODE_COUNT 0x05000D |
| 539 | |
| 540 | /* Free blocks count for group wrong */ |
| 541 | #define PR_5_FREE_BLOCK_COUNT_GROUP 0x05000E |
| 542 | |
| 543 | /* Free blocks count wrong */ |
| 544 | #define PR_5_FREE_BLOCK_COUNT 0x05000F |
| 545 | |
| 546 | /* Programming error: bitmap endpoints don't match */ |
| 547 | #define PR_5_BMAP_ENDPOINTS 0x050010 |
| 548 | |
| 549 | /* Internal error: fudging end of bitmap */ |
| 550 | #define PR_5_FUDGE_BITMAP_ERROR 0x050011 |
| 551 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 552 | /* |
| 553 | * Function declarations |
| 554 | */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 555 | int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx); |
| 556 | int end_problem_latch(e2fsck_t ctx, int mask); |
| 557 | int set_latch_flags(int mask, int setflags, int clearflags); |
| 558 | int get_latch_flags(int mask, int *value); |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 559 | void clear_problem_context(struct problem_context *ctx); |
| 560 | |
| 561 | /* message.c */ |
Theodore Ts'o | 1b6bf17 | 1997-10-03 17:48:10 +0000 | [diff] [blame] | 562 | void print_e2fsck_message(e2fsck_t ctx, const char *msg, |
| 563 | struct problem_context *pctx, int first); |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 564 | |