xref: /openbmc/linux/fs/xfs/libxfs/xfs_errortag.h (revision 254e3459)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
4  * Copyright (C) 2017 Oracle.
5  * All Rights Reserved.
6  */
7 #ifndef __XFS_ERRORTAG_H_
8 #define __XFS_ERRORTAG_H_
9 
10 /*
11  * error injection tags - the labels can be anything you want
12  * but each tag should have its own unique number
13  */
14 
15 #define XFS_ERRTAG_NOERROR				0
16 #define XFS_ERRTAG_IFLUSH_1				1
17 #define XFS_ERRTAG_IFLUSH_2				2
18 #define XFS_ERRTAG_IFLUSH_3				3
19 #define XFS_ERRTAG_IFLUSH_4				4
20 #define XFS_ERRTAG_IFLUSH_5				5
21 #define XFS_ERRTAG_IFLUSH_6				6
22 #define XFS_ERRTAG_DA_READ_BUF				7
23 #define XFS_ERRTAG_BTREE_CHECK_LBLOCK			8
24 #define XFS_ERRTAG_BTREE_CHECK_SBLOCK			9
25 #define XFS_ERRTAG_ALLOC_READ_AGF			10
26 #define XFS_ERRTAG_IALLOC_READ_AGI			11
27 #define XFS_ERRTAG_ITOBP_INOTOBP			12
28 #define XFS_ERRTAG_IUNLINK				13
29 #define XFS_ERRTAG_IUNLINK_REMOVE			14
30 #define XFS_ERRTAG_DIR_INO_VALIDATE			15
31 #define XFS_ERRTAG_BULKSTAT_READ_CHUNK			16
32 #define XFS_ERRTAG_IODONE_IOERR				17
33 #define XFS_ERRTAG_STRATREAD_IOERR			18
34 #define XFS_ERRTAG_STRATCMPL_IOERR			19
35 #define XFS_ERRTAG_DIOWRITE_IOERR			20
36 #define XFS_ERRTAG_BMAPIFORMAT				21
37 #define XFS_ERRTAG_FREE_EXTENT				22
38 #define XFS_ERRTAG_RMAP_FINISH_ONE			23
39 #define XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE		24
40 #define XFS_ERRTAG_REFCOUNT_FINISH_ONE			25
41 #define XFS_ERRTAG_BMAP_FINISH_ONE			26
42 #define XFS_ERRTAG_AG_RESV_CRITICAL			27
43 
44 /*
45  * Drop-writes support removed because write error handling cannot trash
46  * pre-existing delalloc extents in any useful way anymore. We retain the
47  * definition so that we can reject it as an invalid value in
48  * xfs_errortag_valid().
49  */
50 #define XFS_ERRTAG_DROP_WRITES				28
51 #define XFS_ERRTAG_LOG_BAD_CRC				29
52 #define XFS_ERRTAG_LOG_ITEM_PIN				30
53 #define XFS_ERRTAG_BUF_LRU_REF				31
54 #define XFS_ERRTAG_FORCE_SCRUB_REPAIR			32
55 #define XFS_ERRTAG_FORCE_SUMMARY_RECALC			33
56 #define XFS_ERRTAG_IUNLINK_FALLBACK			34
57 #define XFS_ERRTAG_BUF_IOERROR				35
58 #define XFS_ERRTAG_REDUCE_MAX_IEXTENTS			36
59 #define XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT		37
60 #define XFS_ERRTAG_AG_RESV_FAIL				38
61 #define XFS_ERRTAG_LARP					39
62 #define XFS_ERRTAG_DA_LEAF_SPLIT			40
63 #define XFS_ERRTAG_ATTR_LEAF_TO_NODE			41
64 #define XFS_ERRTAG_WB_DELAY_MS				42
65 #define XFS_ERRTAG_WRITE_DELAY_MS			43
66 #define XFS_ERRTAG_MAX					44
67 
68 /*
69  * Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
70  */
71 #define XFS_RANDOM_DEFAULT				100
72 #define XFS_RANDOM_IFLUSH_1				XFS_RANDOM_DEFAULT
73 #define XFS_RANDOM_IFLUSH_2				XFS_RANDOM_DEFAULT
74 #define XFS_RANDOM_IFLUSH_3				XFS_RANDOM_DEFAULT
75 #define XFS_RANDOM_IFLUSH_4				XFS_RANDOM_DEFAULT
76 #define XFS_RANDOM_IFLUSH_5				XFS_RANDOM_DEFAULT
77 #define XFS_RANDOM_IFLUSH_6				XFS_RANDOM_DEFAULT
78 #define XFS_RANDOM_DA_READ_BUF				XFS_RANDOM_DEFAULT
79 #define XFS_RANDOM_BTREE_CHECK_LBLOCK			(XFS_RANDOM_DEFAULT/4)
80 #define XFS_RANDOM_BTREE_CHECK_SBLOCK			XFS_RANDOM_DEFAULT
81 #define XFS_RANDOM_ALLOC_READ_AGF			XFS_RANDOM_DEFAULT
82 #define XFS_RANDOM_IALLOC_READ_AGI			XFS_RANDOM_DEFAULT
83 #define XFS_RANDOM_ITOBP_INOTOBP			XFS_RANDOM_DEFAULT
84 #define XFS_RANDOM_IUNLINK				XFS_RANDOM_DEFAULT
85 #define XFS_RANDOM_IUNLINK_REMOVE			XFS_RANDOM_DEFAULT
86 #define XFS_RANDOM_DIR_INO_VALIDATE			XFS_RANDOM_DEFAULT
87 #define XFS_RANDOM_BULKSTAT_READ_CHUNK			XFS_RANDOM_DEFAULT
88 #define XFS_RANDOM_IODONE_IOERR				(XFS_RANDOM_DEFAULT/10)
89 #define XFS_RANDOM_STRATREAD_IOERR			(XFS_RANDOM_DEFAULT/10)
90 #define XFS_RANDOM_STRATCMPL_IOERR			(XFS_RANDOM_DEFAULT/10)
91 #define XFS_RANDOM_DIOWRITE_IOERR			(XFS_RANDOM_DEFAULT/10)
92 #define XFS_RANDOM_BMAPIFORMAT				XFS_RANDOM_DEFAULT
93 #define XFS_RANDOM_FREE_EXTENT				1
94 #define XFS_RANDOM_RMAP_FINISH_ONE			1
95 #define XFS_RANDOM_REFCOUNT_CONTINUE_UPDATE		1
96 #define XFS_RANDOM_REFCOUNT_FINISH_ONE			1
97 #define XFS_RANDOM_BMAP_FINISH_ONE			1
98 #define XFS_RANDOM_AG_RESV_CRITICAL			4
99 #define XFS_RANDOM_LOG_BAD_CRC				1
100 #define XFS_RANDOM_LOG_ITEM_PIN				1
101 #define XFS_RANDOM_BUF_LRU_REF				2
102 #define XFS_RANDOM_FORCE_SCRUB_REPAIR			1
103 #define XFS_RANDOM_FORCE_SUMMARY_RECALC			1
104 #define XFS_RANDOM_IUNLINK_FALLBACK			(XFS_RANDOM_DEFAULT/10)
105 #define XFS_RANDOM_BUF_IOERROR				XFS_RANDOM_DEFAULT
106 #define XFS_RANDOM_REDUCE_MAX_IEXTENTS			1
107 #define XFS_RANDOM_BMAP_ALLOC_MINLEN_EXTENT		1
108 #define XFS_RANDOM_AG_RESV_FAIL				1
109 #define XFS_RANDOM_LARP					1
110 #define XFS_RANDOM_DA_LEAF_SPLIT			1
111 #define XFS_RANDOM_ATTR_LEAF_TO_NODE			1
112 #define XFS_RANDOM_WB_DELAY_MS				3000
113 #define XFS_RANDOM_WRITE_DELAY_MS			3000
114 
115 #endif /* __XFS_ERRORTAG_H_ */
116