blob: 323b60b8ae8f487ab7a0f536d78992320ed15a0c [file] [log] [blame]
Theodore Ts'o21c84b71997-04-29 16:15:03 +00001/*
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'o1b6bf171997-10-03 17:48:10 +000012typedef __u32 problem_t;
13
Theodore Ts'o21c84b71997-04-29 16:15:03 +000014struct problem_context {
Theodore Ts'o1b6bf171997-10-03 17:48:10 +000015 errcode_t errcode;
Theodore Ts'o21c84b71997-04-29 16:15:03 +000016 ino_t ino, ino2, dir;
17 struct ext2_inode *inode;
18 struct ext2_dir_entry *dirent;
Theodore Ts'o1b6bf171997-10-03 17:48:10 +000019 blk_t blk, blk2;
Theodore Ts'o9d1bd3d1998-06-10 20:45:22 +000020 e2_blkcnt_t blkcount;
Theodore Ts'o246501c1998-03-24 16:22:38 +000021 int group;
22 __u64 num;
Theodore Ts'o1b6bf171997-10-03 17:48:10 +000023 const char *str;
Theodore Ts'o21c84b71997-04-29 16:15:03 +000024};
25
Theodore Ts'o21c84b71997-04-29 16:15:03 +000026/*
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'o1b6bf171997-10-03 17:48:10 +000034#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'o21c84b71997-04-29 16:15:03 +000038
39#define PR_LATCH(x) ((((x) & PR_LATCH_MASK) >> 4) - 1)
40
41/*
Theodore Ts'o1b6bf171997-10-03 17:48:10 +000042 * 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'o21c84b71997-04-29 16:15:03 +000052 * 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'o1b6bf171997-10-03 17:48:10 +000064/* 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'od4b0ce01999-06-18 01:09:29 +000091/* Inode count in the superblock incorrect */
92#define PR_0_INODE_COUNT_WRONG 0x00000D
93
Theodore Ts'o4ea0a112000-05-08 13:33:17 +000094/* The Hurd does not support the filetype feature */
95#define PR_0_HURD_CLEAR_FILETYPE 0x00000E
Theodore Ts'o3b5386d2000-08-14 14:25:19 +000096
97/* Journal inode is invalid */
98#define PR_0_JOURNAL_BAD_INODE 0x00000F
99
100/* Superblock has a journal device (which we can't handle yet) */
101#define PR_0_JOURNAL_UNSUPP_DEV 0x000010
102
103/* Superblock has a bad journal device */
104#define PR_0_JOURNAL_BAD_DEV 0x000011
105
106/* Superblock has a journal UUID (which we can't handle yet) */
107#define PR_0_JOURNAL_UNSUPP_UUID 0x000012
108
109/* Superblock has a bad journal UUID */
110#define PR_0_JOURNAL_BAD_UUID 0x000013
111
112/* Journal has an unknown superblock type */
113#define PR_0_JOURNAL_UNSUPP_SUPER 0x000014
114
115/* Journal superblock is corrupt */
116#define PR_0_JOURNAL_BAD_SUPER 0x000015
117
118/* Journal superblock is corrupt */
119#define PR_0_JOURNAL_HAS_JOURNAL 0x000016
120
121/* Superblock has recovery flag set but no journal */
122#define PR_0_JOURNAL_RECOVER_SET 0x000017
123
124/* Warning message about leaving data in the journal */
125#define PR_0_JOURNAL_RESET_JOURNAL 0x000018
126
127/* Superblock recovery flag clear - journal needs to be reset */
128#define PR_0_JOURNAL_RESET_PROMPT 0x000019
129
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000130/*
131 * Pass 1 errors
132 */
133
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000134/* Pass 1: Checking inodes, blocks, and sizes */
135#define PR_1_PASS_HEADER 0x010000
136
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000137/* Root directory is not an inode */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000138#define PR_1_ROOT_NO_DIR 0x010001
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000139
140/* Root directory has dtime set */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000141#define PR_1_ROOT_DTIME 0x010002
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000142
143/* Reserved inode has bad mode */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000144#define PR_1_RESERVED_BAD_MODE 0x010003
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000145
146/* Deleted inode has zero dtime */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000147#define PR_1_ZERO_DTIME 0x010004
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000148
149/* Inode in use, but dtime set */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000150#define PR_1_SET_DTIME 0x010005
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000151
152/* Zero-length directory */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000153#define PR_1_ZERO_LENGTH_DIR 0x010006
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000154
155/* Block bitmap conflicts with some other fs block */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000156#define PR_1_BB_CONFLICT 0x010007
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000157
158/* Inode bitmap conflicts with some other fs block */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000159#define PR_1_IB_CONFLICT 0x010008
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000160
161/* Inode table conflicts with some other fs block */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000162#define PR_1_ITABLE_CONFLICT 0x010009
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000163
164/* Block bitmap is on a bad block */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000165#define PR_1_BB_BAD_BLOCK 0x01000A
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000166
167/* Inode bitmap is on a bad block */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000168#define PR_1_IB_BAD_BLOCK 0x01000B
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000169
170/* Inode has incorrect i_size */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000171#define PR_1_BAD_I_SIZE 0x01000C
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000172
173/* Inode has incorrect i_blocks */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000174#define PR_1_BAD_I_BLOCKS 0x01000D
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000175
176/* Illegal block number in inode */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000177#define PR_1_ILLEGAL_BLOCK_NUM 0x01000E
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000178
179/* Block number overlaps fs metadata */
180#define PR_1_BLOCK_OVERLAPS_METADATA 0x01000F
181
182/* Inode has illegal blocks (latch question) */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000183#define PR_1_INODE_BLOCK_LATCH 0x010010
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000184
185/* Too many bad blocks in inode */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000186#define PR_1_TOO_MANY_BAD_BLOCKS 0x010011
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000187
188/* Illegal block number in bad block inode */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000189#define PR_1_BB_ILLEGAL_BLOCK_NUM 0x010012
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000190
191/* Bad block inode has illegal blocks (latch question) */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000192#define PR_1_INODE_BBLOCK_LATCH 0x010013
193
194/* Duplicate or bad blocks in use! */
195#define PR_1_DUP_BLOCKS_PREENSTOP 0x010014
196
197/* Bad block used as bad block indirect block */
198#define PR_1_BBINODE_BAD_METABLOCK 0x010015
199
200/* Inconsistency can't be fixed prompt */
201#define PR_1_BBINODE_BAD_METABLOCK_PROMPT 0x010016
202
203/* Bad primary block */
204#define PR_1_BAD_PRIMARY_BLOCK 0x0100017
205
206/* Bad primary block prompt */
207#define PR_1_BAD_PRIMARY_BLOCK_PROMPT 0x0100018
208
209/* Bad primary superblock */
210#define PR_1_BAD_PRIMARY_SUPERBLOCK 0x0100019
211
212/* Bad primary block group descriptors */
213#define PR_1_BAD_PRIMARY_GROUP_DESCRIPTOR 0x010001A
214
215/* Bad superblock in group */
216#define PR_1_BAD_SUPERBLOCK 0x010001B
217
218/* Bad block group descriptors in group */
219#define PR_1_BAD_GROUP_DESCRIPTORS 0x010001C
220
221/* Block claimed for no reason */
222#define PR_1_PROGERR_CLAIMED_BLOCK 0x010001D
223
Theodore Ts'of8188ff1997-11-14 05:23:04 +0000224/* Error allocating blocks for relocating metadata */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000225#define PR_1_RELOC_BLOCK_ALLOCATE 0x010001E
226
Theodore Ts'of8188ff1997-11-14 05:23:04 +0000227/* Error allocating block buffer during relocation process */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000228#define PR_1_RELOC_MEMORY_ALLOCATE 0x010001F
229
230/* Relocating metadata group information from X to Y */
231#define PR_1_RELOC_FROM_TO 0x0100020
232
233/* Relocating metatdata group information to X */
234#define PR_1_RELOC_TO 0x0100021
235
236/* Block read error during relocation process */
237#define PR_1_RELOC_READ_ERR 0x0100022
238
239/* Block write error during relocation process */
240#define PR_1_RELOC_WRITE_ERR 0x0100023
241
242/* Error allocating inode bitmap */
243#define PR_1_ALLOCATE_IBITMAP_ERROR 0x0100024
244
245/* Error allocating block bitmap */
246#define PR_1_ALLOCATE_BBITMAP_ERROR 0x0100025
247
248/* Error allocating icount structure */
249#define PR_1_ALLOCATE_ICOUNT 0x0100026
250
251/* Error allocating dbcount */
252#define PR_1_ALLOCATE_DBCOUNT 0x0100027
253
254/* Error while scanning inodes */
255#define PR_1_ISCAN_ERROR 0x0100028
256
257/* Error while iterating over blocks */
258#define PR_1_BLOCK_ITERATE 0x0100029
259
260/* Error while storing inode count information */
261#define PR_1_ICOUNT_STORE 0x010002A
262
263/* Error while storing directory block information */
264#define PR_1_ADD_DBLOCK 0x010002B
265
266/* Error while reading inode (for clearing) */
267#define PR_1_READ_INODE 0x010002C
268
Theodore Ts'of8188ff1997-11-14 05:23:04 +0000269/* Suppress messages prompt */
270#define PR_1_SUPPRESS_MESSAGES 0x010002D
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000271
Theodore Ts'o246501c1998-03-24 16:22:38 +0000272/* Filesystem contains large files, but has no such flag in sb */
273#define PR_1_FEATURE_LARGE_FILES 0x01002E
274
Theodore Ts'o6fdc7a31999-11-10 13:34:40 +0000275/* Imagic flag set on an inode when filesystem doesn't support it */
276#define PR_1_SET_IMAGIC 0x01002F
277
278/* Immutable flag set on a device or socket inode */
279#define PR_1_SET_IMMUTABLE 0x010030
Theodore Ts'o19178752000-02-11 15:55:07 +0000280
281/* Compression flag set on a non-compressed filesystem */
282#define PR_1_COMPR_SET 0x010031
283
Theodore Ts'od647a1e2000-05-27 14:40:09 +0000284/* Non-zero size on on device, fifo or socket inode */
285#define PR_1_SET_NONZSIZE 0x010032
286
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000287/*
288 * Pass 1b errors
289 */
290
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000291/* Pass 1B: Rescan for duplicate/bad blocks */
292#define PR_1B_PASS_HEADER 0x011000
293
294/* Duplicate/bad block(s) header */
295#define PR_1B_DUP_BLOCK_HEADER 0x011001
296
297/* Duplicate/bad block(s) in inode */
298#define PR_1B_DUP_BLOCK 0x011002
299
300/* Duplicate/bad block(s) end */
301#define PR_1B_DUP_BLOCK_END 0x011003
302
303/* Error while scanning inodes */
304#define PR_1B_ISCAN_ERROR 0x011004
305
306/* Error allocating inode bitmap */
307#define PR_1B_ALLOCATE_IBITMAP_ERROR 0x011005
308
309
310/* Pass 1C: Scan directories for inodes with dup blocks. */
311#define PR_1C_PASS_HEADER 0x012000
312
313
314/* Pass 1D: Reconciling duplicate blocks */
315#define PR_1D_PASS_HEADER 0x013000
316
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000317/* File has duplicate blocks */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000318#define PR_1D_DUP_FILE 0x013001
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000319
320/* List of files sharing duplicate blocks */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000321#define PR_1D_DUP_FILE_LIST 0x013002
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000322
Theodore Ts'o521e3681997-04-29 17:48:10 +0000323/* File sharing blocks with filesystem metadata */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000324#define PR_1D_SHARE_METADATA 0x013003
Theodore Ts'o521e3681997-04-29 17:48:10 +0000325
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000326/* Report of how many duplicate/bad inodes */
327#define PR_1D_NUM_DUP_INODES 0x013004
328
329/* Duplicated blocks already reassigned or cloned. */
330#define PR_1D_DUP_BLOCKS_DEALT 0x013005
331
332/* Clone duplicate/bad blocks? */
333#define PR_1D_CLONE_QUESTION 0x013006
334
335/* Delete file? */
336#define PR_1D_DELETE_QUESTION 0x013007
337
338/* Couldn't clone file (error) */
339#define PR_1D_CLONE_ERROR 0x013008
340
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000341/*
342 * Pass 2 errors
343 */
344
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000345/* Pass 2: Checking directory structure */
346#define PR_2_PASS_HEADER 0x020000
347
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000348/* Bad inode number for '.' */
349#define PR_2_BAD_INODE_DOT 0x020001
350
351/* Directory entry has bad inode number */
352#define PR_2_BAD_INO 0x020002
353
354/* Directory entry has deleted or unused inode */
355#define PR_2_UNUSED_INODE 0x020003
356
357/* Directry entry is link to '.' */
358#define PR_2_LINK_DOT 0x020004
359
360/* Directory entry points to inode now located in a bad block */
361#define PR_2_BB_INODE 0x020005
362
363/* Directory entry contains a link to a directory */
364#define PR_2_LINK_DIR 0x020006
365
366/* Directory entry contains a link to the root directry */
367#define PR_2_LINK_ROOT 0x020007
368
369/* Directory entry has illegal characters in its name */
370#define PR_2_BAD_NAME 0x020008
371
372/* Missing '.' in directory inode */
373#define PR_2_MISSING_DOT 0x020009
374
375/* Missing '..' in directory inode */
376#define PR_2_MISSING_DOT_DOT 0x02000A
377
378/* First entry in directory inode doesn't contain '.' */
379#define PR_2_1ST_NOT_DOT 0x02000B
380
381/* Second entry in directory inode doesn't contain '..' */
382#define PR_2_2ND_NOT_DOT_DOT 0x02000C
383
384/* i_faddr should be zero */
385#define PR_2_FADDR_ZERO 0x02000D
386
387/* i_file_acl should be zero */
388#define PR_2_FILE_ACL_ZERO 0x02000E
389
390/* i_dir_acl should be zero */
391#define PR_2_DIR_ACL_ZERO 0x02000F
392
393/* i_frag should be zero */
394#define PR_2_FRAG_ZERO 0x020010
395
396/* i_fsize should be zero */
397#define PR_2_FSIZE_ZERO 0x020011
398
399/* inode has bad mode */
400#define PR_2_BAD_MODE 0x020012
401
402/* directory corrupted */
403#define PR_2_DIR_CORRUPTED 0x020013
404
405/* filename too long */
406#define PR_2_FILENAME_LONG 0x020014
407
408/* Directory inode has a missing block (hole) */
409#define PR_2_DIRECTORY_HOLE 0x020015
410
411/* '.' is not NULL terminated */
412#define PR_2_DOT_NULL_TERM 0x020016
413
414/* '..' is not NULL terminated */
415#define PR_2_DOT_DOT_NULL_TERM 0x020017
416
Theodore Ts'o7cf73dc1997-08-14 17:17:16 +0000417/* Illegal character device in inode */
418#define PR_2_BAD_CHAR_DEV 0x020018
419
420/* Illegal block device in inode */
421#define PR_2_BAD_BLOCK_DEV 0x020019
422
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000423/* Duplicate '.' entry */
424#define PR_2_DUP_DOT 0x02001A
425
426/* Duplicate '..' entry */
427#define PR_2_DUP_DOT_DOT 0x02001B
428
429/* Internal error: couldn't find dir_info */
430#define PR_2_NO_DIRINFO 0x02001C
431
432/* Final rec_len is wrong */
433#define PR_2_FINAL_RECLEN 0x02001D
434
435/* Error allocating icount structure */
436#define PR_2_ALLOCATE_ICOUNT 0x02001E
437
438/* Error iterating over directory blocks */
439#define PR_2_DBLIST_ITERATE 0x02001F
440
441/* Error reading directory block */
442#define PR_2_READ_DIRBLOCK 0x020020
443
444/* Error writing directory block */
445#define PR_2_WRITE_DIRBLOCK 0x020021
446
447/* Error allocating new directory block */
448#define PR_2_ALLOC_DIRBOCK 0x020022
449
450/* Error deallocating inode */
451#define PR_2_DEALLOC_INODE 0x020023
452
Theodore Ts'of8188ff1997-11-14 05:23:04 +0000453/* Directory entry for '.' is big. Split? */
Theodore Ts'o7142db01999-11-08 18:46:54 +0000454#define PR_2_SPLIT_DOT 0x020024
Theodore Ts'of8188ff1997-11-14 05:23:04 +0000455
Theodore Ts'o1dde43f1998-11-14 04:18:28 +0000456/* Illegal FIFO */
457#define PR_2_BAD_FIFO 0x020025
458
459/* Illegal socket */
460#define PR_2_BAD_SOCKET 0x020026
461
Theodore Ts'oaa4115a1999-10-21 19:33:18 +0000462/* Directory filetype not set */
463#define PR_2_SET_FILETYPE 0x020027
464
465/* Directory filetype incorrect */
466#define PR_2_BAD_FILETYPE 0x020028
467
Theodore Ts'o7847c1d1999-10-22 15:11:42 +0000468/* Directory filetype set when it shouldn't be */
469#define PR_2_CLEAR_FILETYPE 0x020029
470
Theodore Ts'oc40db6d1999-10-25 21:03:34 +0000471/* Directory filename can't be zero-length */
472#define PR_2_NULL_NAME 0x020030
473
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000474/*
475 * Pass 3 errors
476 */
477
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000478/* Pass 3: Checking directory connectivity */
479#define PR_3_PASS_HEADER 0x030000
480
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000481/* Root inode not allocated */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000482#define PR_3_NO_ROOT_INODE 0x030001
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000483
484/* No room in lost+found */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000485#define PR_3_EXPAND_LF_DIR 0x030002
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000486
487/* Unconnected directory inode */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000488#define PR_3_UNCONNECTED_DIR 0x030003
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000489
490/* /lost+found not found */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000491#define PR_3_NO_LF_DIR 0x030004
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000492
493/* .. entry is incorrect */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000494#define PR_3_BAD_DOT_DOT 0x030005
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000495
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000496/* Bad or non-existent /lost+found. Cannot reconnect */
497#define PR_3_NO_LPF 0x030006
498
499/* Could not expand /lost+found */
500#define PR_3_CANT_EXPAND_LPF 0x030007
501
502/* Could not reconnect inode */
503#define PR_3_CANT_RECONNECT 0x030008
504
505/* Error while trying to find /lost+found */
506#define PR_3_ERR_FIND_LPF 0x030009
507
508/* Error in ext2fs_new_block while creating /lost+found */
509#define PR_3_ERR_LPF_NEW_BLOCK 0x03000A
510
511/* Error in ext2fs_new_inode while creating /lost+found */
512#define PR_3_ERR_LPF_NEW_INODE 0x03000B
513
514/* Error in ext2fs_new_dir_block while creating /lost+found */
515#define PR_3_ERR_LPF_NEW_DIR_BLOCK 0x03000C
516
517/* Error while writing directory block for /lost+found */
518#define PR_3_ERR_LPF_WRITE_BLOCK 0x03000D
519
520/* Error while adjusting inode count */
521#define PR_3_ADJUST_INODE 0x03000E
522
523/* Couldn't fix parent directory -- error */
524#define PR_3_FIX_PARENT_ERR 0x03000F
525
526/* Couldn't fix parent directory -- couldn't find it */
527#define PR_3_FIX_PARENT_NOFIND 0x030010
528
529/* Error allocating inode bitmap */
530#define PR_3_ALLOCATE_IBITMAP_ERROR 0x030011
531
532/* Error creating root directory */
533#define PR_3_CREATE_ROOT_ERROR 0x030012
534
535/* Error creating lost and found directory */
536#define PR_3_CREATE_LPF_ERROR 0x030013
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000537
Theodore Ts'of8188ff1997-11-14 05:23:04 +0000538/* Root inode is not directory; aborting */
539#define PR_3_ROOT_NOT_DIR_ABORT 0x030014
540
541/* Cannot proceed without a root inode. */
542#define PR_3_NO_ROOT_INODE_ABORT 0x030015
543
Theodore Ts'o7f813ba1998-09-03 01:26:03 +0000544/* Internal error: couldn't find dir_info */
Theodore Ts'o4a9f5931999-03-16 19:32:52 +0000545#define PR_3_NO_DIRINFO 0x030016
546
547/* Lost+found is not a directory */
548#define PR_3_LPF_NOTDIR 0x030017
Theodore Ts'o7f813ba1998-09-03 01:26:03 +0000549
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000550/*
551 * Pass 4 errors
552 */
553
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000554/* Pass 4: Checking reference counts */
555#define PR_4_PASS_HEADER 0x040000
556
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000557/* Unattached zero-length inode */
558#define PR_4_ZERO_LEN_INODE 0x040001
559
560/* Unattached inode */
561#define PR_4_UNATTACHED_INODE 0x040002
562
563/* Inode ref count wrong */
564#define PR_4_BAD_REF_COUNT 0x040003
565
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000566/* Inconsistent inode count information cached */
567#define PR_4_INCONSISTENT_COUNT 0x040004
568
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000569/*
570 * Pass 5 errors
571 */
572
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000573/* Pass 5: Checking group summary information */
574#define PR_5_PASS_HEADER 0x050000
575
576/* Padding at end of inode bitmap is not set. */
577#define PR_5_INODE_BMAP_PADDING 0x050001
578
579/* Padding at end of block bitmap is not set. */
580#define PR_5_BLOCK_BMAP_PADDING 0x050002
581
582/* Block bitmap differences header */
583#define PR_5_BLOCK_BITMAP_HEADER 0x050003
584
585/* Block not used, but marked in bitmap */
586#define PR_5_UNUSED_BLOCK 0x050004
587
588/* Block used, but not marked used in bitmap */
589#define PR_5_BLOCK_USED 0x050005
590
591/* Block bitmap differences end */
592#define PR_5_BLOCK_BITMAP_END 0x050006
593
594/* Inode bitmap differences header */
595#define PR_5_INODE_BITMAP_HEADER 0x050007
596
597/* Inode not used, but marked in bitmap */
598#define PR_5_UNUSED_INODE 0x050008
599
600/* Inode used, but not marked used in bitmap */
601#define PR_5_INODE_USED 0x050009
602
603/* Inode bitmap differences end */
604#define PR_5_INODE_BITMAP_END 0x05000A
605
606/* Free inodes count for group wrong */
607#define PR_5_FREE_INODE_COUNT_GROUP 0x05000B
608
609/* Directories count for group wrong */
610#define PR_5_FREE_DIR_COUNT_GROUP 0x05000C
611
612/* Free inodes count wrong */
613#define PR_5_FREE_INODE_COUNT 0x05000D
614
615/* Free blocks count for group wrong */
616#define PR_5_FREE_BLOCK_COUNT_GROUP 0x05000E
617
618/* Free blocks count wrong */
619#define PR_5_FREE_BLOCK_COUNT 0x05000F
620
621/* Programming error: bitmap endpoints don't match */
622#define PR_5_BMAP_ENDPOINTS 0x050010
Theodore Ts'obbd47d72000-06-10 19:21:33 +0000623
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000624/* Internal error: fudging end of bitmap */
625#define PR_5_FUDGE_BITMAP_ERROR 0x050011
Theodore Ts'obbd47d72000-06-10 19:21:33 +0000626
627/* Error copying in replacement inode bitmap */
628#define PR_5_COPY_IBITMAP_ERROR 0x050012
629
630/* Error copying in replacement block bitmap */
631#define PR_5_COPY_BBITMAP_ERROR 0x050013
632
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000633/*
634 * Function declarations
635 */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000636int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx);
637int end_problem_latch(e2fsck_t ctx, int mask);
638int set_latch_flags(int mask, int setflags, int clearflags);
639int get_latch_flags(int mask, int *value);
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000640void clear_problem_context(struct problem_context *ctx);
641
642/* message.c */
Theodore Ts'o1b6bf171997-10-03 17:48:10 +0000643void print_e2fsck_message(e2fsck_t ctx, const char *msg,
644 struct problem_context *pctx, int first);
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000645