]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: add leaf split error tag
authorAllison Henderson <allison.henderson@oracle.com>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
Source kernel commit: c3b948be34702a0a81f10662c4040e500a90eb54

Add an error tag on xfs_da3_split to test log attribute recovery
and replay.

Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
io/inject.c
libxfs/xfs_da_btree.c
libxfs/xfs_errortag.h

index 43b51db5b9ccfdddcbd55a38ee840424903b4879..a7ad4df445031f22faecd0f074574b83842d102c 100644 (file)
@@ -59,6 +59,7 @@ error_tag(char *name)
                { XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT,  "bmap_alloc_minlen_extent" },
                { XFS_ERRTAG_AG_RESV_FAIL,              "ag_resv_fail" },
                { XFS_ERRTAG_LARP,                      "larp" },
+               { XFS_ERRTAG_DA_LEAF_SPLIT,             "da_leaf_split" },
                { XFS_ERRTAG_MAX,                       NULL }
        };
        int     count;
index 1f39c108782d1cff15eb6299e6a30ce862e1e792..7ecbc681272531dc8c467ea2fa3d0f6f25fdff2c 100644 (file)
@@ -479,6 +479,9 @@ xfs_da3_split(
 
        trace_xfs_da_split(state->args);
 
+       if (XFS_TEST_ERROR(false, state->mp, XFS_ERRTAG_DA_LEAF_SPLIT))
+               return -EIO;
+
        /*
         * Walk back up the tree splitting/inserting/adjusting as necessary.
         * If we need to insert and there isn't room, split the node, then
index c15d2340220c19e5b107666c34a69a08006931e0..6d06a502bbdfdfe1a1b6755917a5d503a5376376 100644 (file)
@@ -60,7 +60,8 @@
 #define XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT            37
 #define XFS_ERRTAG_AG_RESV_FAIL                                38
 #define XFS_ERRTAG_LARP                                        39
-#define XFS_ERRTAG_MAX                                 40
+#define XFS_ERRTAG_DA_LEAF_SPLIT                       40
+#define XFS_ERRTAG_MAX                                 41
 
 /*
  * Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
 #define XFS_RANDOM_BMAP_ALLOC_MINLEN_EXTENT            1
 #define XFS_RANDOM_AG_RESV_FAIL                                1
 #define XFS_RANDOM_LARP                                        1
+#define XFS_RANDOM_DA_LEAF_SPLIT                       1
 
 #endif /* __XFS_ERRORTAG_H_ */