Blame view
fs/xfs/xfs_error.h
6.64 KB
1da177e4c Linux-2.6.12-rc2 |
1 |
/* |
7b7187698 [XFS] Update lice... |
2 3 |
* Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. * All Rights Reserved. |
1da177e4c Linux-2.6.12-rc2 |
4 |
* |
7b7187698 [XFS] Update lice... |
5 6 |
* This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as |
1da177e4c Linux-2.6.12-rc2 |
7 8 |
* published by the Free Software Foundation. * |
7b7187698 [XFS] Update lice... |
9 10 11 12 |
* This program is distributed in the hope that it would be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. |
1da177e4c Linux-2.6.12-rc2 |
13 |
* |
7b7187698 [XFS] Update lice... |
14 15 16 |
* You should have received a copy of the GNU General Public License * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1da177e4c Linux-2.6.12-rc2 |
17 18 19 |
*/ #ifndef __XFS_ERROR_H__ #define __XFS_ERROR_H__ |
1da177e4c Linux-2.6.12-rc2 |
20 |
struct xfs_mount; |
a0e856b0b xfs: add const qu... |
21 |
extern void xfs_error_report(const char *tag, int level, struct xfs_mount *mp, |
fc51c2b5f xfs: remove inst_t |
22 |
const char *filename, int linenum, void *ra); |
a0e856b0b xfs: add const qu... |
23 24 |
extern void xfs_corruption_error(const char *tag, int level, struct xfs_mount *mp, void *p, const char *filename, |
fc51c2b5f xfs: remove inst_t |
25 |
int linenum, void *ra); |
ca23f8fdd xfs: add xfs_veri... |
26 |
extern void xfs_verifier_error(struct xfs_buf *bp); |
1da177e4c Linux-2.6.12-rc2 |
27 |
|
1da177e4c Linux-2.6.12-rc2 |
28 29 30 31 32 33 34 35 36 37 38 |
#define XFS_ERROR_REPORT(e, lvl, mp) \ xfs_error_report(e, lvl, mp, __FILE__, __LINE__, __return_address) #define XFS_CORRUPTION_ERROR(e, lvl, mp, mem) \ xfs_corruption_error(e, lvl, mp, mem, \ __FILE__, __LINE__, __return_address) #define XFS_ERRLEVEL_OFF 0 #define XFS_ERRLEVEL_LOW 1 #define XFS_ERRLEVEL_HIGH 5 /* |
a844f4510 [XFS] Remove xfs_... |
39 40 |
* Macros to set EFSCORRUPTED & return/branch. */ |
c29aad411 xfs: pass mp to X... |
41 |
#define XFS_WANT_CORRUPTED_GOTO(mp, x, l) \ |
a844f4510 [XFS] Remove xfs_... |
42 43 44 45 46 |
{ \ int fs_is_ok = (x); \ ASSERT(fs_is_ok); \ if (unlikely(!fs_is_ok)) { \ XFS_ERROR_REPORT("XFS_WANT_CORRUPTED_GOTO", \ |
c29aad411 xfs: pass mp to X... |
47 |
XFS_ERRLEVEL_LOW, mp); \ |
2451337dd xfs: global error... |
48 |
error = -EFSCORRUPTED; \ |
a844f4510 [XFS] Remove xfs_... |
49 50 51 |
goto l; \ } \ } |
5fb5aeeeb xfs: pass mp to X... |
52 |
#define XFS_WANT_CORRUPTED_RETURN(mp, x) \ |
a844f4510 [XFS] Remove xfs_... |
53 54 55 56 57 |
{ \ int fs_is_ok = (x); \ ASSERT(fs_is_ok); \ if (unlikely(!fs_is_ok)) { \ XFS_ERROR_REPORT("XFS_WANT_CORRUPTED_RETURN", \ |
5fb5aeeeb xfs: pass mp to X... |
58 |
XFS_ERRLEVEL_LOW, mp); \ |
2451337dd xfs: global error... |
59 |
return -EFSCORRUPTED; \ |
a844f4510 [XFS] Remove xfs_... |
60 61 62 63 |
} \ } /* |
1da177e4c Linux-2.6.12-rc2 |
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
* error injection tags - the labels can be anything you want * but each tag should have its own unique number */ #define XFS_ERRTAG_NOERROR 0 #define XFS_ERRTAG_IFLUSH_1 1 #define XFS_ERRTAG_IFLUSH_2 2 #define XFS_ERRTAG_IFLUSH_3 3 #define XFS_ERRTAG_IFLUSH_4 4 #define XFS_ERRTAG_IFLUSH_5 5 #define XFS_ERRTAG_IFLUSH_6 6 #define XFS_ERRTAG_DA_READ_BUF 7 #define XFS_ERRTAG_BTREE_CHECK_LBLOCK 8 #define XFS_ERRTAG_BTREE_CHECK_SBLOCK 9 #define XFS_ERRTAG_ALLOC_READ_AGF 10 #define XFS_ERRTAG_IALLOC_READ_AGI 11 #define XFS_ERRTAG_ITOBP_INOTOBP 12 #define XFS_ERRTAG_IUNLINK 13 #define XFS_ERRTAG_IUNLINK_REMOVE 14 #define XFS_ERRTAG_DIR_INO_VALIDATE 15 #define XFS_ERRTAG_BULKSTAT_READ_CHUNK 16 #define XFS_ERRTAG_IODONE_IOERR 17 #define XFS_ERRTAG_STRATREAD_IOERR 18 #define XFS_ERRTAG_STRATCMPL_IOERR 19 #define XFS_ERRTAG_DIOWRITE_IOERR 20 #define XFS_ERRTAG_BMAPIFORMAT 21 |
ba9e78024 xfs: add tracepoi... |
90 |
#define XFS_ERRTAG_FREE_EXTENT 22 |
9c1946446 xfs: propagate bm... |
91 |
#define XFS_ERRTAG_RMAP_FINISH_ONE 23 |
317272581 xfs: adjust refco... |
92 |
#define XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE 24 |
33ba61292 xfs: connect refc... |
93 |
#define XFS_ERRTAG_REFCOUNT_FINISH_ONE 25 |
9f3afb57d xfs: implement de... |
94 |
#define XFS_ERRTAG_BMAP_FINISH_ONE 26 |
a35eb4151 xfs: simulate per... |
95 |
#define XFS_ERRTAG_AG_RESV_CRITICAL 27 |
f8c47250b xfs: convert drop... |
96 97 98 99 100 101 102 103 104 |
/* * DEBUG mode instrumentation to test and/or trigger delayed allocation * block killing in the event of failed writes. When enabled, all * buffered writes are silenty dropped and handled as if they failed. * All delalloc blocks in the range of the write (including pre-existing * delalloc blocks!) are tossed as part of the write failure error * handling sequence. */ #define XFS_ERRTAG_DROP_WRITES 28 |
3e88a0078 xfs: replace log_... |
105 |
#define XFS_ERRTAG_LOG_BAD_CRC 29 |
7f4d01f36 xfs: add log item... |
106 107 |
#define XFS_ERRTAG_LOG_ITEM_PIN 30 #define XFS_ERRTAG_MAX 31 |
1da177e4c Linux-2.6.12-rc2 |
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
/* * Random factors for above tags, 1 means always, 2 means 1/2 time, etc. */ #define XFS_RANDOM_DEFAULT 100 #define XFS_RANDOM_IFLUSH_1 XFS_RANDOM_DEFAULT #define XFS_RANDOM_IFLUSH_2 XFS_RANDOM_DEFAULT #define XFS_RANDOM_IFLUSH_3 XFS_RANDOM_DEFAULT #define XFS_RANDOM_IFLUSH_4 XFS_RANDOM_DEFAULT #define XFS_RANDOM_IFLUSH_5 XFS_RANDOM_DEFAULT #define XFS_RANDOM_IFLUSH_6 XFS_RANDOM_DEFAULT #define XFS_RANDOM_DA_READ_BUF XFS_RANDOM_DEFAULT #define XFS_RANDOM_BTREE_CHECK_LBLOCK (XFS_RANDOM_DEFAULT/4) #define XFS_RANDOM_BTREE_CHECK_SBLOCK XFS_RANDOM_DEFAULT #define XFS_RANDOM_ALLOC_READ_AGF XFS_RANDOM_DEFAULT #define XFS_RANDOM_IALLOC_READ_AGI XFS_RANDOM_DEFAULT #define XFS_RANDOM_ITOBP_INOTOBP XFS_RANDOM_DEFAULT #define XFS_RANDOM_IUNLINK XFS_RANDOM_DEFAULT #define XFS_RANDOM_IUNLINK_REMOVE XFS_RANDOM_DEFAULT #define XFS_RANDOM_DIR_INO_VALIDATE XFS_RANDOM_DEFAULT #define XFS_RANDOM_BULKSTAT_READ_CHUNK XFS_RANDOM_DEFAULT #define XFS_RANDOM_IODONE_IOERR (XFS_RANDOM_DEFAULT/10) #define XFS_RANDOM_STRATREAD_IOERR (XFS_RANDOM_DEFAULT/10) #define XFS_RANDOM_STRATCMPL_IOERR (XFS_RANDOM_DEFAULT/10) #define XFS_RANDOM_DIOWRITE_IOERR (XFS_RANDOM_DEFAULT/10) #define XFS_RANDOM_BMAPIFORMAT XFS_RANDOM_DEFAULT |
ba9e78024 xfs: add tracepoi... |
134 |
#define XFS_RANDOM_FREE_EXTENT 1 |
9c1946446 xfs: propagate bm... |
135 |
#define XFS_RANDOM_RMAP_FINISH_ONE 1 |
317272581 xfs: adjust refco... |
136 |
#define XFS_RANDOM_REFCOUNT_CONTINUE_UPDATE 1 |
33ba61292 xfs: connect refc... |
137 |
#define XFS_RANDOM_REFCOUNT_FINISH_ONE 1 |
9f3afb57d xfs: implement de... |
138 |
#define XFS_RANDOM_BMAP_FINISH_ONE 1 |
a35eb4151 xfs: simulate per... |
139 |
#define XFS_RANDOM_AG_RESV_CRITICAL 4 |
f8c47250b xfs: convert drop... |
140 |
#define XFS_RANDOM_DROP_WRITES 1 |
3e88a0078 xfs: replace log_... |
141 |
#define XFS_RANDOM_LOG_BAD_CRC 1 |
7f4d01f36 xfs: add log item... |
142 |
#define XFS_RANDOM_LOG_ITEM_PIN 1 |
1da177e4c Linux-2.6.12-rc2 |
143 |
|
1550d0b0b [XFS] kill INDUCE... |
144 |
#ifdef DEBUG |
31965ef34 xfs: make errorta... |
145 146 147 148 |
extern int xfs_errortag_init(struct xfs_mount *mp); extern void xfs_errortag_del(struct xfs_mount *mp); extern bool xfs_errortag_test(struct xfs_mount *mp, const char *expression, const char *file, int line, unsigned int error_tag); |
9e24cfd04 xfs: remove unnee... |
149 |
#define XFS_TEST_ERROR(expr, mp, tag) \ |
31965ef34 xfs: make errorta... |
150 |
((expr) || xfs_errortag_test((mp), #expr, __FILE__, __LINE__, (tag))) |
1da177e4c Linux-2.6.12-rc2 |
151 |
|
c68401011 xfs: expose error... |
152 |
extern int xfs_errortag_get(struct xfs_mount *mp, unsigned int error_tag); |
31965ef34 xfs: make errorta... |
153 154 155 156 |
extern int xfs_errortag_set(struct xfs_mount *mp, unsigned int error_tag, unsigned int tag_value); extern int xfs_errortag_add(struct xfs_mount *mp, unsigned int error_tag); extern int xfs_errortag_clearall(struct xfs_mount *mp); |
1da177e4c Linux-2.6.12-rc2 |
157 |
#else |
31965ef34 xfs: make errorta... |
158 159 |
#define xfs_errortag_init(mp) (0) #define xfs_errortag_del(mp) |
9e24cfd04 xfs: remove unnee... |
160 |
#define XFS_TEST_ERROR(expr, mp, tag) (expr) |
31965ef34 xfs: make errorta... |
161 162 163 |
#define xfs_errortag_set(mp, tag, val) (ENOSYS) #define xfs_errortag_add(mp, tag) (ENOSYS) #define xfs_errortag_clearall(mp) (ENOSYS) |
1550d0b0b [XFS] kill INDUCE... |
164 |
#endif /* DEBUG */ |
1da177e4c Linux-2.6.12-rc2 |
165 166 |
/* |
6a19d9393 xfs: convert xfs_... |
167 168 |
* XFS panic tags -- allow a call to xfs_alert_tag() be turned into * a panic by setting xfs_panic_mask in a sysctl. |
1da177e4c Linux-2.6.12-rc2 |
169 170 171 172 173 174 175 176 177 |
*/ #define XFS_NO_PTAG 0 #define XFS_PTAG_IFLUSH 0x00000001 #define XFS_PTAG_LOGRES 0x00000002 #define XFS_PTAG_AILDELETE 0x00000004 #define XFS_PTAG_ERROR_REPORT 0x00000008 #define XFS_PTAG_SHUTDOWN_CORRUPT 0x00000010 #define XFS_PTAG_SHUTDOWN_IOERROR 0x00000020 #define XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040 |
572d95f49 [XFS] Improve err... |
178 |
#define XFS_PTAG_FSBLOCK_ZERO 0x00000080 |
1da177e4c Linux-2.6.12-rc2 |
179 |
|
1da177e4c Linux-2.6.12-rc2 |
180 |
#endif /* __XFS_ERROR_H__ */ |