]>
Commit | Line | Data |
---|---|---|
21c84b71 TT |
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 | ||
1b6bf175 TT |
12 | typedef __u32 problem_t; |
13 | ||
21c84b71 | 14 | struct problem_context { |
1b6bf175 | 15 | errcode_t errcode; |
86c627ec | 16 | ext2_ino_t ino, ino2, dir; |
21c84b71 TT |
17 | struct ext2_inode *inode; |
18 | struct ext2_dir_entry *dirent; | |
1b6bf175 | 19 | blk_t blk, blk2; |
9d1bd3de | 20 | e2_blkcnt_t blkcount; |
246501c6 TT |
21 | int group; |
22 | __u64 num; | |
1b6bf175 | 23 | const char *str; |
21c84b71 TT |
24 | }; |
25 | ||
21c84b71 TT |
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 | */ | |
21afac09 | 31 | #define PR_LATCH_MASK 0x0ff0 /* Latch mask */ |
21c84b71 TT |
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) */ | |
1b6bf175 TT |
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 */ | |
21afac09 | 38 | #define PR_LATCH_LOW_DTIME 0x0070 /* Latch for pass1 orphaned list refugees */ |
da307041 | 39 | #define PR_LATCH_TOOBIG 0x0080 /* Latch for file to big errors */ |
850d05e9 | 40 | #define PR_LATCH_OPTIMIZE_DIR 0x0090 /* Latch for optimize directories */ |
21c84b71 TT |
41 | |
42 | #define PR_LATCH(x) ((((x) & PR_LATCH_MASK) >> 4) - 1) | |
43 | ||
1b6bf175 TT |
44 | /* |
45 | * Latch group descriptor flags | |
46 | */ | |
47 | #define PRL_YES 0x0001 /* Answer yes */ | |
48 | #define PRL_NO 0x0002 /* Answer no */ | |
49 | #define PRL_LATCHED 0x0004 /* The latch group is latched */ | |
50 | #define PRL_SUPPRESS 0x0008 /* Suppress all latch group questions */ | |
51 | ||
52 | #define PRL_VARIABLE 0x000f /* All the flags that need to be reset */ | |
53 | ||
21c84b71 TT |
54 | /* |
55 | * Pre-Pass 1 errors | |
56 | */ | |
57 | ||
58 | /* Block bitmap not in group */ | |
59 | #define PR_0_BB_NOT_GROUP 0x000001 | |
60 | ||
61 | /* Inode bitmap not in group */ | |
62 | #define PR_0_IB_NOT_GROUP 0x000002 | |
63 | ||
64 | /* Inode table not in group */ | |
65 | #define PR_0_ITABLE_NOT_GROUP 0x000003 | |
66 | ||
1b6bf175 TT |
67 | /* Superblock corrupt */ |
68 | #define PR_0_SB_CORRUPT 0x000004 | |
69 | ||
70 | /* Filesystem size is wrong */ | |
71 | #define PR_0_FS_SIZE_WRONG 0x000005 | |
72 | ||
73 | /* Fragments not supported */ | |
74 | #define PR_0_NO_FRAGMENTS 0x000006 | |
75 | ||
76 | /* Bad blocks_per_group */ | |
77 | #define PR_0_BLOCKS_PER_GROUP 0x000007 | |
78 | ||
79 | /* Bad first_data_block */ | |
80 | #define PR_0_FIRST_DATA_BLOCK 0x000008 | |
81 | ||
82 | /* Adding UUID to filesystem */ | |
83 | #define PR_0_ADD_UUID 0x000009 | |
84 | ||
85 | /* Relocate hint */ | |
86 | #define PR_0_RELOCATE_HINT 0x00000A | |
87 | ||
88 | /* Miscellaneous superblock corruption */ | |
89 | #define PR_0_MISC_CORRUPT_SUPER 0x00000B | |
90 | ||
91 | /* Error determing physical device size of filesystem */ | |
92 | #define PR_0_GETSIZE_ERROR 0x00000C | |
93 | ||
d4b0ce03 TT |
94 | /* Inode count in the superblock incorrect */ |
95 | #define PR_0_INODE_COUNT_WRONG 0x00000D | |
96 | ||
4ea0a110 TT |
97 | /* The Hurd does not support the filetype feature */ |
98 | #define PR_0_HURD_CLEAR_FILETYPE 0x00000E | |
3b5386dc TT |
99 | |
100 | /* Journal inode is invalid */ | |
101 | #define PR_0_JOURNAL_BAD_INODE 0x00000F | |
102 | ||
adee8d75 TT |
103 | /* The external journal has multiple filesystems (which we can't handle yet) */ |
104 | #define PR_0_JOURNAL_UNSUPP_MULTIFS 0x000010 | |
3b5386dc | 105 | |
adee8d75 TT |
106 | /* Can't find external journal */ |
107 | #define PR_0_CANT_FIND_JOURNAL 0x000011 | |
3b5386dc | 108 | |
adee8d75 TT |
109 | /* External journal has bad superblock */ |
110 | #define PR_0_EXT_JOURNAL_BAD_SUPER 0x000012 | |
3b5386dc TT |
111 | |
112 | /* Superblock has a bad journal UUID */ | |
113 | #define PR_0_JOURNAL_BAD_UUID 0x000013 | |
114 | ||
115 | /* Journal has an unknown superblock type */ | |
116 | #define PR_0_JOURNAL_UNSUPP_SUPER 0x000014 | |
117 | ||
118 | /* Journal superblock is corrupt */ | |
119 | #define PR_0_JOURNAL_BAD_SUPER 0x000015 | |
120 | ||
121 | /* Journal superblock is corrupt */ | |
122 | #define PR_0_JOURNAL_HAS_JOURNAL 0x000016 | |
123 | ||
124 | /* Superblock has recovery flag set but no journal */ | |
125 | #define PR_0_JOURNAL_RECOVER_SET 0x000017 | |
126 | ||
d37066a9 TT |
127 | /* Journal has data, but recovery flag is clear */ |
128 | #define PR_0_JOURNAL_RECOVERY_CLEAR 0x000018 | |
3b5386dc | 129 | |
d37066a9 TT |
130 | /* Ask if we should clear the journal */ |
131 | #define PR_0_JOURNAL_RESET_JOURNAL 0x000019 | |
3b5386dc | 132 | |
060b5fbf TT |
133 | /* Filesystem revision is 0, but feature flags are set */ |
134 | #define PR_0_FS_REV_LEVEL 0x00001A | |
135 | ||
ecf1b776 | 136 | /* Clearing orphan inode */ |
8394902e | 137 | #define PR_0_ORPHAN_CLEAR_INODE 0x000020 |
ecf1b776 | 138 | |
80bfaa3e | 139 | /* Illegal block found in orphaned inode */ |
ecf1b776 | 140 | #define PR_0_ORPHAN_ILLEGAL_BLOCK_NUM 0x000021 |
80bfaa3e TT |
141 | |
142 | /* Already cleared block found in orphaned inode */ | |
ecf1b776 | 143 | #define PR_0_ORPHAN_ALREADY_CLEARED_BLOCK 0x000022 |
80bfaa3e TT |
144 | |
145 | /* Illegal orphan inode in superblock */ | |
ecf1b776 | 146 | #define PR_0_ORPHAN_ILLEGAL_HEAD_INODE 0x000023 |
80bfaa3e TT |
147 | |
148 | /* Illegal inode in orphaned inode list */ | |
ecf1b776 | 149 | #define PR_0_ORPHAN_ILLEGAL_INODE 0x000024 |
80bfaa3e | 150 | |
424cd2be TT |
151 | /* Journal has unsupported read-only feature - abort */ |
152 | #define PR_0_JOURNAL_UNSUPP_ROCOMPAT 0x000025 | |
153 | ||
154 | /* Journal has unsupported incompatible feature - abort */ | |
155 | #define PR_0_JOURNAL_UNSUPP_INCOMPAT 0x000026 | |
156 | ||
c7f23364 | 157 | /* Journal has unsupported version number */ |
2f686ace | 158 | #define PR_0_JOURNAL_UNSUPP_VERSION 0x000027 |
c7f23364 | 159 | |
773fd8a1 TT |
160 | /* Moving journal to hidden file */ |
161 | #define PR_0_MOVE_JOURNAL 0x000028 | |
162 | ||
163 | /* Error moving journal */ | |
164 | #define PR_0_ERR_MOVE_JOURNAL 0x000029 | |
165 | ||
62e3e7fe TT |
166 | /* Clearing V2 journal superblock */ |
167 | #define PR_0_CLEAR_V2_JOURNAL 0x00002A | |
168 | ||
d37066a9 TT |
169 | /* Run journal anyway */ |
170 | #define PR_0_JOURNAL_RUN 0x00002B | |
171 | ||
172 | /* Run journal anyway by default */ | |
173 | #define PR_0_JOURNAL_RUN_DEFAULT 0x00002C | |
174 | ||
a435ec34 TT |
175 | /* Backup journal inode blocks */ |
176 | #define PR_0_BACKUP_JNL 0x00002D | |
177 | ||
e75cfc5d TT |
178 | /* Reserved blocks w/o resize_inode */ |
179 | #define PR_0_NONZERO_RESERVED_GDT_BLOCKS 0x00002E | |
180 | ||
181 | /* Resize_inode not enabled, but resize inode is non-zero */ | |
182 | #define PR_0_CLEAR_RESIZE_INODE 0x00002F | |
183 | ||
c3ffaf83 TT |
184 | /* Resize inode invalid */ |
185 | #define PR_0_RESIZE_INODE_INVALID 0x000030 | |
186 | ||
8dceb924 TT |
187 | /* Last mount time is in the future */ |
188 | #define PR_0_FUTURE_SB_LAST_MOUNT 0x000031 | |
189 | ||
190 | /* Last write time is in the future */ | |
191 | #define PR_0_FUTURE_SB_LAST_WRITE 0x000032 | |
192 | ||
b1c52b26 TT |
193 | /* Superblock hint for external journal incorrect */ |
194 | #define PR_0_EXTERNAL_JOURNAL_HINT 0x000033 | |
195 | ||
21c84b71 TT |
196 | /* |
197 | * Pass 1 errors | |
198 | */ | |
199 | ||
1b6bf175 TT |
200 | /* Pass 1: Checking inodes, blocks, and sizes */ |
201 | #define PR_1_PASS_HEADER 0x010000 | |
202 | ||
21c84b71 | 203 | /* Root directory is not an inode */ |
1b6bf175 | 204 | #define PR_1_ROOT_NO_DIR 0x010001 |
21c84b71 TT |
205 | |
206 | /* Root directory has dtime set */ | |
1b6bf175 | 207 | #define PR_1_ROOT_DTIME 0x010002 |
21c84b71 TT |
208 | |
209 | /* Reserved inode has bad mode */ | |
1b6bf175 | 210 | #define PR_1_RESERVED_BAD_MODE 0x010003 |
21c84b71 TT |
211 | |
212 | /* Deleted inode has zero dtime */ | |
1b6bf175 | 213 | #define PR_1_ZERO_DTIME 0x010004 |
21c84b71 TT |
214 | |
215 | /* Inode in use, but dtime set */ | |
1b6bf175 | 216 | #define PR_1_SET_DTIME 0x010005 |
21c84b71 TT |
217 | |
218 | /* Zero-length directory */ | |
1b6bf175 | 219 | #define PR_1_ZERO_LENGTH_DIR 0x010006 |
21c84b71 TT |
220 | |
221 | /* Block bitmap conflicts with some other fs block */ | |
1b6bf175 | 222 | #define PR_1_BB_CONFLICT 0x010007 |
21c84b71 TT |
223 | |
224 | /* Inode bitmap conflicts with some other fs block */ | |
1b6bf175 | 225 | #define PR_1_IB_CONFLICT 0x010008 |
21c84b71 TT |
226 | |
227 | /* Inode table conflicts with some other fs block */ | |
1b6bf175 | 228 | #define PR_1_ITABLE_CONFLICT 0x010009 |
21c84b71 TT |
229 | |
230 | /* Block bitmap is on a bad block */ | |
1b6bf175 | 231 | #define PR_1_BB_BAD_BLOCK 0x01000A |
21c84b71 TT |
232 | |
233 | /* Inode bitmap is on a bad block */ | |
1b6bf175 | 234 | #define PR_1_IB_BAD_BLOCK 0x01000B |
21c84b71 TT |
235 | |
236 | /* Inode has incorrect i_size */ | |
1b6bf175 | 237 | #define PR_1_BAD_I_SIZE 0x01000C |
21c84b71 TT |
238 | |
239 | /* Inode has incorrect i_blocks */ | |
1b6bf175 | 240 | #define PR_1_BAD_I_BLOCKS 0x01000D |
21c84b71 TT |
241 | |
242 | /* Illegal block number in inode */ | |
1b6bf175 | 243 | #define PR_1_ILLEGAL_BLOCK_NUM 0x01000E |
21c84b71 TT |
244 | |
245 | /* Block number overlaps fs metadata */ | |
246 | #define PR_1_BLOCK_OVERLAPS_METADATA 0x01000F | |
247 | ||
248 | /* Inode has illegal blocks (latch question) */ | |
1b6bf175 | 249 | #define PR_1_INODE_BLOCK_LATCH 0x010010 |
21c84b71 TT |
250 | |
251 | /* Too many bad blocks in inode */ | |
1b6bf175 | 252 | #define PR_1_TOO_MANY_BAD_BLOCKS 0x010011 |
21c84b71 TT |
253 | |
254 | /* Illegal block number in bad block inode */ | |
1b6bf175 | 255 | #define PR_1_BB_ILLEGAL_BLOCK_NUM 0x010012 |
21c84b71 TT |
256 | |
257 | /* Bad block inode has illegal blocks (latch question) */ | |
1b6bf175 TT |
258 | #define PR_1_INODE_BBLOCK_LATCH 0x010013 |
259 | ||
260 | /* Duplicate or bad blocks in use! */ | |
261 | #define PR_1_DUP_BLOCKS_PREENSTOP 0x010014 | |
262 | ||
263 | /* Bad block used as bad block indirect block */ | |
264 | #define PR_1_BBINODE_BAD_METABLOCK 0x010015 | |
265 | ||
266 | /* Inconsistency can't be fixed prompt */ | |
267 | #define PR_1_BBINODE_BAD_METABLOCK_PROMPT 0x010016 | |
268 | ||
269 | /* Bad primary block */ | |
b2f93192 | 270 | #define PR_1_BAD_PRIMARY_BLOCK 0x010017 |
1b6bf175 TT |
271 | |
272 | /* Bad primary block prompt */ | |
b2f93192 | 273 | #define PR_1_BAD_PRIMARY_BLOCK_PROMPT 0x010018 |
1b6bf175 TT |
274 | |
275 | /* Bad primary superblock */ | |
b2f93192 | 276 | #define PR_1_BAD_PRIMARY_SUPERBLOCK 0x010019 |
1b6bf175 TT |
277 | |
278 | /* Bad primary block group descriptors */ | |
b2f93192 | 279 | #define PR_1_BAD_PRIMARY_GROUP_DESCRIPTOR 0x01001A |
1b6bf175 TT |
280 | |
281 | /* Bad superblock in group */ | |
b2f93192 | 282 | #define PR_1_BAD_SUPERBLOCK 0x01001B |
1b6bf175 TT |
283 | |
284 | /* Bad block group descriptors in group */ | |
b2f93192 | 285 | #define PR_1_BAD_GROUP_DESCRIPTORS 0x01001C |
1b6bf175 TT |
286 | |
287 | /* Block claimed for no reason */ | |
b2f93192 | 288 | #define PR_1_PROGERR_CLAIMED_BLOCK 0x01001D |
1b6bf175 | 289 | |
f8188fff | 290 | /* Error allocating blocks for relocating metadata */ |
b2f93192 | 291 | #define PR_1_RELOC_BLOCK_ALLOCATE 0x01001E |
1b6bf175 | 292 | |
f8188fff | 293 | /* Error allocating block buffer during relocation process */ |
b2f93192 | 294 | #define PR_1_RELOC_MEMORY_ALLOCATE 0x01001F |
1b6bf175 TT |
295 | |
296 | /* Relocating metadata group information from X to Y */ | |
b2f93192 | 297 | #define PR_1_RELOC_FROM_TO 0x010020 |
1b6bf175 TT |
298 | |
299 | /* Relocating metatdata group information to X */ | |
b2f93192 | 300 | #define PR_1_RELOC_TO 0x010021 |
1b6bf175 TT |
301 | |
302 | /* Block read error during relocation process */ | |
b2f93192 | 303 | #define PR_1_RELOC_READ_ERR 0x010022 |
1b6bf175 TT |
304 | |
305 | /* Block write error during relocation process */ | |
b2f93192 | 306 | #define PR_1_RELOC_WRITE_ERR 0x010023 |
1b6bf175 TT |
307 | |
308 | /* Error allocating inode bitmap */ | |
b2f93192 | 309 | #define PR_1_ALLOCATE_IBITMAP_ERROR 0x010024 |
1b6bf175 TT |
310 | |
311 | /* Error allocating block bitmap */ | |
b2f93192 | 312 | #define PR_1_ALLOCATE_BBITMAP_ERROR 0x010025 |
1b6bf175 TT |
313 | |
314 | /* Error allocating icount structure */ | |
b2f93192 | 315 | #define PR_1_ALLOCATE_ICOUNT 0x010026 |
1b6bf175 TT |
316 | |
317 | /* Error allocating dbcount */ | |
b2f93192 | 318 | #define PR_1_ALLOCATE_DBCOUNT 0x010027 |
1b6bf175 TT |
319 | |
320 | /* Error while scanning inodes */ | |
b2f93192 | 321 | #define PR_1_ISCAN_ERROR 0x010028 |
1b6bf175 TT |
322 | |
323 | /* Error while iterating over blocks */ | |
b2f93192 | 324 | #define PR_1_BLOCK_ITERATE 0x010029 |
1b6bf175 TT |
325 | |
326 | /* Error while storing inode count information */ | |
b2f93192 | 327 | #define PR_1_ICOUNT_STORE 0x01002A |
1b6bf175 TT |
328 | |
329 | /* Error while storing directory block information */ | |
b2f93192 | 330 | #define PR_1_ADD_DBLOCK 0x01002B |
1b6bf175 TT |
331 | |
332 | /* Error while reading inode (for clearing) */ | |
b2f93192 | 333 | #define PR_1_READ_INODE 0x01002C |
1b6bf175 | 334 | |
f8188fff | 335 | /* Suppress messages prompt */ |
b2f93192 | 336 | #define PR_1_SUPPRESS_MESSAGES 0x01002D |
21c84b71 | 337 | |
6fdc7a32 TT |
338 | /* Imagic flag set on an inode when filesystem doesn't support it */ |
339 | #define PR_1_SET_IMAGIC 0x01002F | |
340 | ||
341 | /* Immutable flag set on a device or socket inode */ | |
342 | #define PR_1_SET_IMMUTABLE 0x010030 | |
1917875f TT |
343 | |
344 | /* Compression flag set on a non-compressed filesystem */ | |
345 | #define PR_1_COMPR_SET 0x010031 | |
346 | ||
d647a1ea TT |
347 | /* Non-zero size on on device, fifo or socket inode */ |
348 | #define PR_1_SET_NONZSIZE 0x010032 | |
349 | ||
060b5fbf TT |
350 | /* Filesystem revision is 0, but feature flags are set */ |
351 | #define PR_1_FS_REV_LEVEL 0x010033 | |
352 | ||
f18996c8 | 353 | /* Journal inode not in use, needs clearing */ |
a9ca2016 | 354 | #define PR_1_JOURNAL_INODE_NOT_CLEAR 0x010034 |
f18996c8 | 355 | |
a9ca2016 TT |
356 | /* Journal inode has wrong mode */ |
357 | #define PR_1_JOURNAL_BAD_MODE 0x010035 | |
21afac09 TT |
358 | |
359 | /* Inode that was part of orphan linked list */ | |
360 | #define PR_1_LOW_DTIME 0x010036 | |
361 | ||
362 | /* Latch question which asks how to deal with low dtime inodes */ | |
363 | #define PR_1_ORPHAN_LIST_REFUGEES 0x010037 | |
342d847d TT |
364 | |
365 | /* Error allocating refcount structure */ | |
366 | #define PR_1_ALLOCATE_REFCOUNT 0x010038 | |
a9ca2016 | 367 | |
342d847d TT |
368 | /* Error reading Extended Attribute block */ |
369 | #define PR_1_READ_EA_BLOCK 0x010039 | |
370 | ||
371 | /* Invalid Extended Attribute block */ | |
372 | #define PR_1_BAD_EA_BLOCK 0x01003A | |
373 | ||
e8a3ee62 TT |
374 | /* Error reading Extended Attribute block while fixing refcount -- abort */ |
375 | #define PR_1_EXTATTR_READ_ABORT 0x01003B | |
376 | ||
377 | /* Extended attribute reference count incorrect */ | |
378 | #define PR_1_EXTATTR_REFCOUNT 0x01003C | |
379 | ||
380 | /* Error writing Extended Attribute block while fixing refcount */ | |
381 | #define PR_1_EXTATTR_WRITE 0x01003D | |
55fd07ed TT |
382 | |
383 | /* Multiple EA blocks not supported */ | |
384 | #define PR_1_EA_MULTI_BLOCK 0x01003E | |
385 | ||
386 | /* Error allocating EA region allocation structure */ | |
387 | #define PR_1_EA_ALLOC_REGION 0x01003F | |
b94a052a | 388 | |
55fd07ed TT |
389 | /* Error EA allocation collision */ |
390 | #define PR_1_EA_ALLOC_COLLISION 0x010040 | |
b94a052a | 391 | |
55fd07ed TT |
392 | /* Bad extended attribute name */ |
393 | #define PR_1_EA_BAD_NAME 0x010041 | |
394 | ||
395 | /* Bad extended attribute value */ | |
b94a052a AD |
396 | #define PR_1_EA_BAD_VALUE 0x010042 |
397 | ||
da307041 TT |
398 | /* Inode too big (latch question) */ |
399 | #define PR_1_INODE_TOOBIG 0x010043 | |
400 | ||
401 | /* Directory too big */ | |
402 | #define PR_1_TOOBIG_DIR 0x010044 | |
403 | ||
404 | /* Regular file too big */ | |
405 | #define PR_1_TOOBIG_REG 0x010045 | |
406 | ||
407 | /* Symlink too big */ | |
408 | #define PR_1_TOOBIG_SYMLINK 0x010046 | |
409 | ||
8fdc9985 TT |
410 | /* INDEX_FL flag set on a non-HTREE filesystem */ |
411 | #define PR_1_HTREE_SET 0x010047 | |
412 | ||
503f9e7f TT |
413 | /* INDEX_FL flag set on a non-directory */ |
414 | #define PR_1_HTREE_NODIR 0x010048 | |
415 | ||
416 | /* Invalid root node in HTREE directory */ | |
417 | #define PR_1_HTREE_BADROOT 0x010049 | |
418 | ||
419 | /* Unsupported hash version in HTREE directory */ | |
420 | #define PR_1_HTREE_HASHV 0x01004A | |
421 | ||
422 | /* Incompatible flag in HTREE root node */ | |
423 | #define PR_1_HTREE_INCOMPAT 0x01004B | |
424 | ||
425 | /* HTREE too deep */ | |
426 | #define PR_1_HTREE_DEPTH 0x01004C | |
427 | ||
000ba404 TT |
428 | /* Bad block has indirect block that conflicts with filesystem block */ |
429 | #define PR_1_BB_FS_BLOCK 0x01004D | |
430 | ||
c3ffaf83 TT |
431 | /* Resize inode failed */ |
432 | #define PR_1_RESIZE_INODE_CREATE 0x01004E | |
433 | ||
cebe48a1 TT |
434 | /* inode->i_size is too long */ |
435 | #define PR_1_EXTRA_ISIZE 0x01004F | |
436 | ||
437 | /* attribute name is too long */ | |
438 | #define PR_1_ATTR_NAME_LEN 0x010050 | |
439 | ||
440 | /* wrong EA value offset */ | |
441 | #define PR_1_ATTR_VALUE_OFFSET 0x010051 | |
442 | ||
443 | /* wrong EA blocknumber */ | |
444 | #define PR_1_ATTR_VALUE_BLOCK 0x010052 | |
445 | ||
446 | /* wrong EA value size */ | |
447 | #define PR_1_ATTR_VALUE_SIZE 0x010053 | |
448 | ||
449 | /* wrong EA hash value */ | |
450 | #define PR_1_ATTR_HASH 0x010054 | |
451 | ||
21c84b71 TT |
452 | /* |
453 | * Pass 1b errors | |
454 | */ | |
455 | ||
1b6bf175 TT |
456 | /* Pass 1B: Rescan for duplicate/bad blocks */ |
457 | #define PR_1B_PASS_HEADER 0x011000 | |
458 | ||
459 | /* Duplicate/bad block(s) header */ | |
460 | #define PR_1B_DUP_BLOCK_HEADER 0x011001 | |
461 | ||
462 | /* Duplicate/bad block(s) in inode */ | |
463 | #define PR_1B_DUP_BLOCK 0x011002 | |
464 | ||
465 | /* Duplicate/bad block(s) end */ | |
466 | #define PR_1B_DUP_BLOCK_END 0x011003 | |
467 | ||
468 | /* Error while scanning inodes */ | |
469 | #define PR_1B_ISCAN_ERROR 0x011004 | |
470 | ||
471 | /* Error allocating inode bitmap */ | |
472 | #define PR_1B_ALLOCATE_IBITMAP_ERROR 0x011005 | |
473 | ||
133a56dc TT |
474 | /* Error while iterating over blocks */ |
475 | #define PR_1B_BLOCK_ITERATE 0x0110006 | |
1b6bf175 | 476 | |
0684a4f3 TT |
477 | /* Error adjusting EA refcount */ |
478 | #define PR_1B_ADJ_EA_REFCOUNT 0x0110007 | |
479 | ||
480 | ||
1b6bf175 TT |
481 | /* Pass 1C: Scan directories for inodes with dup blocks. */ |
482 | #define PR_1C_PASS_HEADER 0x012000 | |
483 | ||
484 | ||
485 | /* Pass 1D: Reconciling duplicate blocks */ | |
486 | #define PR_1D_PASS_HEADER 0x013000 | |
487 | ||
21c84b71 | 488 | /* File has duplicate blocks */ |
1b6bf175 | 489 | #define PR_1D_DUP_FILE 0x013001 |
21c84b71 TT |
490 | |
491 | /* List of files sharing duplicate blocks */ | |
1b6bf175 | 492 | #define PR_1D_DUP_FILE_LIST 0x013002 |
21c84b71 | 493 | |
521e3685 | 494 | /* File sharing blocks with filesystem metadata */ |
1b6bf175 TT |
495 | #define PR_1D_SHARE_METADATA 0x013003 |
496 | ||
497 | /* Report of how many duplicate/bad inodes */ | |
498 | #define PR_1D_NUM_DUP_INODES 0x013004 | |
499 | ||
500 | /* Duplicated blocks already reassigned or cloned. */ | |
501 | #define PR_1D_DUP_BLOCKS_DEALT 0x013005 | |
502 | ||
503 | /* Clone duplicate/bad blocks? */ | |
504 | #define PR_1D_CLONE_QUESTION 0x013006 | |
505 | ||
506 | /* Delete file? */ | |
507 | #define PR_1D_DELETE_QUESTION 0x013007 | |
521e3685 | 508 | |
1b6bf175 TT |
509 | /* Couldn't clone file (error) */ |
510 | #define PR_1D_CLONE_ERROR 0x013008 | |
511 | ||
21c84b71 TT |
512 | /* |
513 | * Pass 2 errors | |
514 | */ | |
515 | ||
1b6bf175 TT |
516 | /* Pass 2: Checking directory structure */ |
517 | #define PR_2_PASS_HEADER 0x020000 | |
518 | ||
21c84b71 TT |
519 | /* Bad inode number for '.' */ |
520 | #define PR_2_BAD_INODE_DOT 0x020001 | |
521 | ||
522 | /* Directory entry has bad inode number */ | |
523 | #define PR_2_BAD_INO 0x020002 | |
524 | ||
525 | /* Directory entry has deleted or unused inode */ | |
526 | #define PR_2_UNUSED_INODE 0x020003 | |
527 | ||
528 | /* Directry entry is link to '.' */ | |
529 | #define PR_2_LINK_DOT 0x020004 | |
530 | ||
531 | /* Directory entry points to inode now located in a bad block */ | |
532 | #define PR_2_BB_INODE 0x020005 | |
533 | ||
534 | /* Directory entry contains a link to a directory */ | |
535 | #define PR_2_LINK_DIR 0x020006 | |
536 | ||
537 | /* Directory entry contains a link to the root directry */ | |
538 | #define PR_2_LINK_ROOT 0x020007 | |
539 | ||
540 | /* Directory entry has illegal characters in its name */ | |
541 | #define PR_2_BAD_NAME 0x020008 | |
542 | ||
543 | /* Missing '.' in directory inode */ | |
544 | #define PR_2_MISSING_DOT 0x020009 | |
545 | ||
546 | /* Missing '..' in directory inode */ | |
547 | #define PR_2_MISSING_DOT_DOT 0x02000A | |
548 | ||
549 | /* First entry in directory inode doesn't contain '.' */ | |
550 | #define PR_2_1ST_NOT_DOT 0x02000B | |
551 | ||
552 | /* Second entry in directory inode doesn't contain '..' */ | |
553 | #define PR_2_2ND_NOT_DOT_DOT 0x02000C | |
554 | ||
555 | /* i_faddr should be zero */ | |
556 | #define PR_2_FADDR_ZERO 0x02000D | |
557 | ||
558 | /* i_file_acl should be zero */ | |
559 | #define PR_2_FILE_ACL_ZERO 0x02000E | |
560 | ||
561 | /* i_dir_acl should be zero */ | |
562 | #define PR_2_DIR_ACL_ZERO 0x02000F | |
563 | ||
564 | /* i_frag should be zero */ | |
565 | #define PR_2_FRAG_ZERO 0x020010 | |
566 | ||
567 | /* i_fsize should be zero */ | |
568 | #define PR_2_FSIZE_ZERO 0x020011 | |
569 | ||
570 | /* inode has bad mode */ | |
571 | #define PR_2_BAD_MODE 0x020012 | |
572 | ||
573 | /* directory corrupted */ | |
574 | #define PR_2_DIR_CORRUPTED 0x020013 | |
575 | ||
576 | /* filename too long */ | |
577 | #define PR_2_FILENAME_LONG 0x020014 | |
578 | ||
579 | /* Directory inode has a missing block (hole) */ | |
580 | #define PR_2_DIRECTORY_HOLE 0x020015 | |
581 | ||
582 | /* '.' is not NULL terminated */ | |
583 | #define PR_2_DOT_NULL_TERM 0x020016 | |
584 | ||
585 | /* '..' is not NULL terminated */ | |
586 | #define PR_2_DOT_DOT_NULL_TERM 0x020017 | |
587 | ||
7cf73dcd TT |
588 | /* Illegal character device in inode */ |
589 | #define PR_2_BAD_CHAR_DEV 0x020018 | |
590 | ||
591 | /* Illegal block device in inode */ | |
592 | #define PR_2_BAD_BLOCK_DEV 0x020019 | |
593 | ||
1b6bf175 TT |
594 | /* Duplicate '.' entry */ |
595 | #define PR_2_DUP_DOT 0x02001A | |
596 | ||
597 | /* Duplicate '..' entry */ | |
598 | #define PR_2_DUP_DOT_DOT 0x02001B | |
599 | ||
600 | /* Internal error: couldn't find dir_info */ | |
601 | #define PR_2_NO_DIRINFO 0x02001C | |
602 | ||
603 | /* Final rec_len is wrong */ | |
604 | #define PR_2_FINAL_RECLEN 0x02001D | |
605 | ||
606 | /* Error allocating icount structure */ | |
607 | #define PR_2_ALLOCATE_ICOUNT 0x02001E | |
608 | ||
609 | /* Error iterating over directory blocks */ | |
610 | #define PR_2_DBLIST_ITERATE 0x02001F | |
611 | ||
612 | /* Error reading directory block */ | |
613 | #define PR_2_READ_DIRBLOCK 0x020020 | |
614 | ||
615 | /* Error writing directory block */ | |
616 | #define PR_2_WRITE_DIRBLOCK 0x020021 | |
617 | ||
618 | /* Error allocating new directory block */ | |
619 | #define PR_2_ALLOC_DIRBOCK 0x020022 | |
620 | ||
621 | /* Error deallocating inode */ | |
622 | #define PR_2_DEALLOC_INODE 0x020023 | |
623 | ||
f8188fff | 624 | /* Directory entry for '.' is big. Split? */ |
7142db08 | 625 | #define PR_2_SPLIT_DOT 0x020024 |
f8188fff | 626 | |
1dde43f0 TT |
627 | /* Illegal FIFO */ |
628 | #define PR_2_BAD_FIFO 0x020025 | |
629 | ||
630 | /* Illegal socket */ | |
631 | #define PR_2_BAD_SOCKET 0x020026 | |
632 | ||
aa4115a4 TT |
633 | /* Directory filetype not set */ |
634 | #define PR_2_SET_FILETYPE 0x020027 | |
635 | ||
636 | /* Directory filetype incorrect */ | |
637 | #define PR_2_BAD_FILETYPE 0x020028 | |
638 | ||
7847c1d4 TT |
639 | /* Directory filetype set when it shouldn't be */ |
640 | #define PR_2_CLEAR_FILETYPE 0x020029 | |
641 | ||
c40db6d5 TT |
642 | /* Directory filename can't be zero-length */ |
643 | #define PR_2_NULL_NAME 0x020030 | |
644 | ||
bcf9c5d4 TT |
645 | /* Invalid symlink */ |
646 | #define PR_2_INVALID_SYMLINK 0x020031 | |
fdbdea09 | 647 | |
342d847d TT |
648 | /* i_file_acl (extended attribute) is bad */ |
649 | #define PR_2_FILE_ACL_BAD 0x020032 | |
650 | ||
a4742691 TT |
651 | /* Filesystem contains large files, but has no such flag in sb */ |
652 | #define PR_2_FEATURE_LARGE_FILES 0x020033 | |
653 | ||
8fdc9985 TT |
654 | /* Node in HTREE directory not referenced */ |
655 | #define PR_2_HTREE_NOTREF 0x020034 | |
656 | ||
657 | /* Node in HTREE directory referenced twice */ | |
658 | #define PR_2_HTREE_DUPREF 0x020035 | |
659 | ||
660 | /* Node in HTREE directory has bad min hash */ | |
661 | #define PR_2_HTREE_MIN_HASH 0x020036 | |
662 | ||
663 | /* Node in HTREE directory has bad max hash */ | |
664 | #define PR_2_HTREE_MAX_HASH 0x020037 | |
665 | ||
666 | /* Clear invalid HTREE directory */ | |
667 | #define PR_2_HTREE_CLEAR 0x020038 | |
668 | ||
669 | /* Clear the htree flag forcibly */ | |
33db8f80 | 670 | /* #define PR_2_HTREE_FCLR 0x020039 */ |
8fdc9985 TT |
671 | |
672 | /* Bad block in htree interior node */ | |
673 | #define PR_2_HTREE_BADBLK 0x02003A | |
674 | ||
0684a4f3 TT |
675 | /* Error adjusting EA refcount */ |
676 | #define PR_2_ADJ_EA_REFCOUNT 0x02003B | |
677 | ||
ea1959f0 TT |
678 | /* Invalid HTREE root node */ |
679 | #define PR_2_HTREE_BAD_ROOT 0x02003C | |
680 | ||
ad4fa466 TT |
681 | /* Invalid HTREE limit */ |
682 | #define PR_2_HTREE_BAD_LIMIT 0x02003D | |
683 | ||
684 | /* Invalid HTREE count */ | |
685 | #define PR_2_HTREE_BAD_COUNT 0x02003E | |
686 | ||
687 | /* HTREE interior node has out-of-order hashes in table */ | |
688 | #define PR_2_HTREE_HASH_ORDER 0x02003F | |
689 | ||
690 | /* Node in HTREE directory has bad depth */ | |
b0700a1b TT |
691 | #define PR_2_HTREE_BAD_DEPTH 0x020040 |
692 | ||
693 | /* Duplicate directory entry found */ | |
694 | #define PR_2_DUPLICATE_DIRENT 0x020041 | |
695 | ||
696 | /* Non-unique filename found */ | |
697 | #define PR_2_NON_UNIQUE_FILE 0x020042 | |
ad4fa466 | 698 | |
0926668d TT |
699 | /* Duplicate directory entry found */ |
700 | #define PR_2_REPORT_DUP_DIRENT 0x020043 | |
701 | ||
21c84b71 TT |
702 | /* |
703 | * Pass 3 errors | |
704 | */ | |
705 | ||
1b6bf175 TT |
706 | /* Pass 3: Checking directory connectivity */ |
707 | #define PR_3_PASS_HEADER 0x030000 | |
708 | ||
21c84b71 | 709 | /* Root inode not allocated */ |
1b6bf175 | 710 | #define PR_3_NO_ROOT_INODE 0x030001 |
21c84b71 TT |
711 | |
712 | /* No room in lost+found */ | |
1b6bf175 | 713 | #define PR_3_EXPAND_LF_DIR 0x030002 |
21c84b71 TT |
714 | |
715 | /* Unconnected directory inode */ | |
1b6bf175 | 716 | #define PR_3_UNCONNECTED_DIR 0x030003 |
21c84b71 TT |
717 | |
718 | /* /lost+found not found */ | |
1b6bf175 | 719 | #define PR_3_NO_LF_DIR 0x030004 |
21c84b71 TT |
720 | |
721 | /* .. entry is incorrect */ | |
1b6bf175 TT |
722 | #define PR_3_BAD_DOT_DOT 0x030005 |
723 | ||
724 | /* Bad or non-existent /lost+found. Cannot reconnect */ | |
725 | #define PR_3_NO_LPF 0x030006 | |
726 | ||
727 | /* Could not expand /lost+found */ | |
728 | #define PR_3_CANT_EXPAND_LPF 0x030007 | |
729 | ||
730 | /* Could not reconnect inode */ | |
731 | #define PR_3_CANT_RECONNECT 0x030008 | |
732 | ||
733 | /* Error while trying to find /lost+found */ | |
734 | #define PR_3_ERR_FIND_LPF 0x030009 | |
735 | ||
736 | /* Error in ext2fs_new_block while creating /lost+found */ | |
737 | #define PR_3_ERR_LPF_NEW_BLOCK 0x03000A | |
21c84b71 | 738 | |
1b6bf175 TT |
739 | /* Error in ext2fs_new_inode while creating /lost+found */ |
740 | #define PR_3_ERR_LPF_NEW_INODE 0x03000B | |
741 | ||
742 | /* Error in ext2fs_new_dir_block while creating /lost+found */ | |
743 | #define PR_3_ERR_LPF_NEW_DIR_BLOCK 0x03000C | |
744 | ||
745 | /* Error while writing directory block for /lost+found */ | |
746 | #define PR_3_ERR_LPF_WRITE_BLOCK 0x03000D | |
747 | ||
748 | /* Error while adjusting inode count */ | |
749 | #define PR_3_ADJUST_INODE 0x03000E | |
750 | ||
751 | /* Couldn't fix parent directory -- error */ | |
752 | #define PR_3_FIX_PARENT_ERR 0x03000F | |
753 | ||
754 | /* Couldn't fix parent directory -- couldn't find it */ | |
755 | #define PR_3_FIX_PARENT_NOFIND 0x030010 | |
756 | ||
757 | /* Error allocating inode bitmap */ | |
758 | #define PR_3_ALLOCATE_IBITMAP_ERROR 0x030011 | |
759 | ||
760 | /* Error creating root directory */ | |
761 | #define PR_3_CREATE_ROOT_ERROR 0x030012 | |
762 | ||
763 | /* Error creating lost and found directory */ | |
764 | #define PR_3_CREATE_LPF_ERROR 0x030013 | |
21c84b71 | 765 | |
f8188fff TT |
766 | /* Root inode is not directory; aborting */ |
767 | #define PR_3_ROOT_NOT_DIR_ABORT 0x030014 | |
768 | ||
769 | /* Cannot proceed without a root inode. */ | |
770 | #define PR_3_NO_ROOT_INODE_ABORT 0x030015 | |
771 | ||
7f813ba3 | 772 | /* Internal error: couldn't find dir_info */ |
4a9f5936 TT |
773 | #define PR_3_NO_DIRINFO 0x030016 |
774 | ||
775 | /* Lost+found is not a directory */ | |
776 | #define PR_3_LPF_NOTDIR 0x030017 | |
7f813ba3 | 777 | |
b7a00563 TT |
778 | /* |
779 | * Pass 3a --- rehashing diretories | |
780 | */ | |
781 | /* Pass 3a: Reindexing directories */ | |
782 | #define PR_3A_PASS_HEADER 0x031000 | |
783 | ||
784 | /* Error iterating over directories */ | |
850d05e9 | 785 | #define PR_3A_OPTIMIZE_ITER 0x031001 |
b7a00563 TT |
786 | |
787 | /* Error rehash directory */ | |
850d05e9 | 788 | #define PR_3A_OPTIMIZE_DIR_ERR 0x031002 |
b7a00563 TT |
789 | |
790 | /* Rehashing dir header */ | |
850d05e9 | 791 | #define PR_3A_OPTIMIZE_DIR_HEADER 0x031003 |
b7a00563 TT |
792 | |
793 | /* Rehashing directory %d */ | |
850d05e9 | 794 | #define PR_3A_OPTIMIZE_DIR 0x031004 |
b7a00563 TT |
795 | |
796 | /* Rehashing dir end */ | |
850d05e9 TT |
797 | #define PR_3A_OPTIMIZE_DIR_END 0x031005 |
798 | ||
21c84b71 TT |
799 | /* |
800 | * Pass 4 errors | |
801 | */ | |
802 | ||
1b6bf175 TT |
803 | /* Pass 4: Checking reference counts */ |
804 | #define PR_4_PASS_HEADER 0x040000 | |
805 | ||
21c84b71 TT |
806 | /* Unattached zero-length inode */ |
807 | #define PR_4_ZERO_LEN_INODE 0x040001 | |
808 | ||
809 | /* Unattached inode */ | |
810 | #define PR_4_UNATTACHED_INODE 0x040002 | |
811 | ||
812 | /* Inode ref count wrong */ | |
813 | #define PR_4_BAD_REF_COUNT 0x040003 | |
814 | ||
1b6bf175 TT |
815 | /* Inconsistent inode count information cached */ |
816 | #define PR_4_INCONSISTENT_COUNT 0x040004 | |
817 | ||
21c84b71 TT |
818 | /* |
819 | * Pass 5 errors | |
820 | */ | |
821 | ||
1b6bf175 TT |
822 | /* Pass 5: Checking group summary information */ |
823 | #define PR_5_PASS_HEADER 0x050000 | |
824 | ||
825 | /* Padding at end of inode bitmap is not set. */ | |
826 | #define PR_5_INODE_BMAP_PADDING 0x050001 | |
827 | ||
828 | /* Padding at end of block bitmap is not set. */ | |
829 | #define PR_5_BLOCK_BMAP_PADDING 0x050002 | |
830 | ||
831 | /* Block bitmap differences header */ | |
832 | #define PR_5_BLOCK_BITMAP_HEADER 0x050003 | |
833 | ||
834 | /* Block not used, but marked in bitmap */ | |
f122632e | 835 | #define PR_5_BLOCK_UNUSED 0x050004 |
1b6bf175 TT |
836 | |
837 | /* Block used, but not marked used in bitmap */ | |
838 | #define PR_5_BLOCK_USED 0x050005 | |
839 | ||
840 | /* Block bitmap differences end */ | |
841 | #define PR_5_BLOCK_BITMAP_END 0x050006 | |
842 | ||
843 | /* Inode bitmap differences header */ | |
844 | #define PR_5_INODE_BITMAP_HEADER 0x050007 | |
845 | ||
846 | /* Inode not used, but marked in bitmap */ | |
f122632e | 847 | #define PR_5_INODE_UNUSED 0x050008 |
1b6bf175 TT |
848 | |
849 | /* Inode used, but not marked used in bitmap */ | |
850 | #define PR_5_INODE_USED 0x050009 | |
851 | ||
852 | /* Inode bitmap differences end */ | |
853 | #define PR_5_INODE_BITMAP_END 0x05000A | |
854 | ||
855 | /* Free inodes count for group wrong */ | |
856 | #define PR_5_FREE_INODE_COUNT_GROUP 0x05000B | |
857 | ||
858 | /* Directories count for group wrong */ | |
859 | #define PR_5_FREE_DIR_COUNT_GROUP 0x05000C | |
860 | ||
861 | /* Free inodes count wrong */ | |
862 | #define PR_5_FREE_INODE_COUNT 0x05000D | |
863 | ||
864 | /* Free blocks count for group wrong */ | |
865 | #define PR_5_FREE_BLOCK_COUNT_GROUP 0x05000E | |
866 | ||
867 | /* Free blocks count wrong */ | |
868 | #define PR_5_FREE_BLOCK_COUNT 0x05000F | |
869 | ||
870 | /* Programming error: bitmap endpoints don't match */ | |
871 | #define PR_5_BMAP_ENDPOINTS 0x050010 | |
bbd47d76 | 872 | |
1b6bf175 TT |
873 | /* Internal error: fudging end of bitmap */ |
874 | #define PR_5_FUDGE_BITMAP_ERROR 0x050011 | |
bbd47d76 TT |
875 | |
876 | /* Error copying in replacement inode bitmap */ | |
877 | #define PR_5_COPY_IBITMAP_ERROR 0x050012 | |
878 | ||
879 | /* Error copying in replacement block bitmap */ | |
880 | #define PR_5_COPY_BBITMAP_ERROR 0x050013 | |
881 | ||
f122632e TT |
882 | /* Block range not used, but marked in bitmap */ |
883 | #define PR_5_BLOCK_RANGE_UNUSED 0x050014 | |
884 | ||
885 | /* Block range used, but not marked used in bitmap */ | |
886 | #define PR_5_BLOCK_RANGE_USED 0x050015 | |
887 | ||
888 | /* Inode range not used, but marked in bitmap */ | |
889 | #define PR_5_INODE_RANGE_UNUSED 0x050016 | |
890 | ||
891 | /* Inode rangeused, but not marked used in bitmap */ | |
892 | #define PR_5_INODE_RANGE_USED 0x050017 | |
893 | ||
21c84b71 TT |
894 | /* |
895 | * Function declarations | |
896 | */ | |
1b6bf175 TT |
897 | int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx); |
898 | int end_problem_latch(e2fsck_t ctx, int mask); | |
899 | int set_latch_flags(int mask, int setflags, int clearflags); | |
900 | int get_latch_flags(int mask, int *value); | |
21c84b71 TT |
901 | void clear_problem_context(struct problem_context *ctx); |
902 | ||
903 | /* message.c */ | |
1b6bf175 TT |
904 | void print_e2fsck_message(e2fsck_t ctx, const char *msg, |
905 | struct problem_context *pctx, int first); | |
21c84b71 | 906 |