]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: move error injection tags into their own file
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 17 Nov 2017 04:11:34 +0000 (22:11 -0600)
committerEric Sandeen <sandeen@redhat.com>
Fri, 17 Nov 2017 04:11:34 +0000 (22:11 -0600)
Source kernel commit: e9e899a2a8c3c23b3084b048466f417ed92286d3

Move the error injection tag names into a libxfs header so that we can
share it between kernel and userspace.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/Makefile
libxfs/xfs_ag_resv.c
libxfs/xfs_alloc.c
libxfs/xfs_bmap.c
libxfs/xfs_btree.c
libxfs/xfs_dir2.c
libxfs/xfs_errortag.h [new file with mode: 0644]
libxfs/xfs_ialloc.c
libxfs/xfs_inode_buf.c
libxfs/xfs_refcount.c
libxfs/xfs_rmap.c

index d248c1fc65aec7f4175425d2c69d24a973438274..cc5c44f683348ae4848410cc9a3169c9e0e0f5c3 100644 (file)
@@ -31,6 +31,7 @@ HFILES = \
        xfs_cksum.h \
        xfs_da_btree.h \
        xfs_dir2.h \
+       xfs_errortag.h \
        xfs_ialloc.h \
        xfs_ialloc_btree.h \
        xfs_inode_buf.h \
index addc440b3fea1782a775ff583872ebe27afc3cbc..219b571ecacb0beab7c91b240e07b444648001c5 100644 (file)
@@ -27,6 +27,7 @@
 #include "xfs_mount.h"
 #include "xfs_defer.h"
 #include "xfs_alloc.h"
+#include "xfs_errortag.h"
 #include "xfs_trace.h"
 #include "xfs_cksum.h"
 #include "xfs_trans.h"
index 31058ab2f9fc90ee326254f7f8c94da98f86bf56..766f365f20a5c5b5a0a9513cba187b6bdd803995 100644 (file)
@@ -30,6 +30,7 @@
 #include "xfs_rmap.h"
 #include "xfs_alloc_btree.h"
 #include "xfs_alloc.h"
+#include "xfs_errortag.h"
 #include "xfs_cksum.h"
 #include "xfs_trace.h"
 #include "xfs_trans.h"
index 905095371e13b81a6e05765abf2a7092ac2608ec..8c0a9a584ff74b51d071cfc088a78b33aa0b67bf 100644 (file)
@@ -34,6 +34,7 @@
 #include "xfs_alloc.h"
 #include "xfs_bmap.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_errortag.h"
 #include "xfs_trans_space.h"
 #include "xfs_trace.h"
 #include "xfs_attr_leaf.h"
index c655d5beeec54987f4a2ade30494569e016e8795..59bd142b8291aef27c1b9b0280dabf7d41fed5bc 100644 (file)
@@ -27,6 +27,7 @@
 #include "xfs_inode.h"
 #include "xfs_trans.h"
 #include "xfs_btree.h"
+#include "xfs_errortag.h"
 #include "xfs_trace.h"
 #include "xfs_cksum.h"
 #include "xfs_alloc.h"
index 49d56e7baefe2e2236f7a2e4931b81a3bc382b57..2f0a6e9e89190400fd9a65efa3c96f20e02b3d76 100644 (file)
@@ -30,6 +30,7 @@
 #include "xfs_dir2.h"
 #include "xfs_dir2_priv.h"
 #include "xfs_ialloc.h"
+#include "xfs_errortag.h"
 #include "xfs_trace.h"
 
 struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR };
diff --git a/libxfs/xfs_errortag.h b/libxfs/xfs_errortag.h
new file mode 100644 (file)
index 0000000..bc1789d
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
+ * Copyright (C) 2017 Oracle.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * 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.
+ *
+ * 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.
+ */
+#ifndef __XFS_ERRORTAG_H_
+#define __XFS_ERRORTAG_H_
+
+/*
+ * 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
+#define XFS_ERRTAG_FREE_EXTENT                         22
+#define XFS_ERRTAG_RMAP_FINISH_ONE                     23
+#define XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE            24
+#define XFS_ERRTAG_REFCOUNT_FINISH_ONE                 25
+#define XFS_ERRTAG_BMAP_FINISH_ONE                     26
+#define XFS_ERRTAG_AG_RESV_CRITICAL                    27
+/*
+ * 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
+#define XFS_ERRTAG_LOG_BAD_CRC                         29
+#define XFS_ERRTAG_LOG_ITEM_PIN                                30
+#define XFS_ERRTAG_BUF_LRU_REF                         31
+#define XFS_ERRTAG_MAX                                 32
+
+/*
+ * 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
+#define XFS_RANDOM_FREE_EXTENT                         1
+#define XFS_RANDOM_RMAP_FINISH_ONE                     1
+#define XFS_RANDOM_REFCOUNT_CONTINUE_UPDATE            1
+#define XFS_RANDOM_REFCOUNT_FINISH_ONE                 1
+#define XFS_RANDOM_BMAP_FINISH_ONE                     1
+#define XFS_RANDOM_AG_RESV_CRITICAL                    4
+#define XFS_RANDOM_DROP_WRITES                         1
+#define XFS_RANDOM_LOG_BAD_CRC                         1
+#define XFS_RANDOM_LOG_ITEM_PIN                                1
+#define XFS_RANDOM_BUF_LRU_REF                         2
+
+#endif /* __XFS_ERRORTAG_H_ */
index 50a030a9205f0d86c71432609c202bab66d79c0a..2eaf57c7e46295763c6affaa23beb4d7f4e2e0a8 100644 (file)
@@ -30,6 +30,7 @@
 #include "xfs_ialloc.h"
 #include "xfs_ialloc_btree.h"
 #include "xfs_alloc.h"
+#include "xfs_errortag.h"
 #include "xfs_bmap.h"
 #include "xfs_cksum.h"
 #include "xfs_trans.h"
index b0f2c0d602c09c8566dc493f3c6dc50bdaa6ea1a..a3a5239b6ce5d08a104b1037fb6c83bd2c46f249 100644 (file)
@@ -24,6 +24,7 @@
 #include "xfs_mount.h"
 #include "xfs_defer.h"
 #include "xfs_inode.h"
+#include "xfs_errortag.h"
 #include "xfs_cksum.h"
 #include "xfs_trans.h"
 #include "xfs_ialloc.h"
index 2c79473ac7512196dc6c52b8a9a7507ce7d2a826..4fb63b8503b5c39cf8d40ee1151ed05734e9e977 100644 (file)
@@ -30,6 +30,7 @@
 #include "xfs_bmap.h"
 #include "xfs_refcount_btree.h"
 #include "xfs_alloc.h"
+#include "xfs_errortag.h"
 #include "xfs_trace.h"
 #include "xfs_cksum.h"
 #include "xfs_trans.h"
index addc9526786a984d370b2842dda1067c17952c32..c0f589237ef0f0e1cd0bda1ebf2bd18183076eb4 100644 (file)
@@ -34,6 +34,7 @@
 #include "xfs_rmap_btree.h"
 #include "xfs_trans_space.h"
 #include "xfs_trace.h"
+#include "xfs_errortag.h"
 #include "xfs_bmap.h"
 #include "xfs_inode.h"