]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: add debug knob to slow down writeback for fun
authorDarrick J. Wong <djwong@kernel.org>
Wed, 15 Mar 2023 14:53:19 +0000 (15:53 +0100)
committerCarlos Maiolino <cem@kernel.org>
Fri, 17 Mar 2023 10:38:46 +0000 (11:38 +0100)
Source kernel commit: c2beff99eb03866df6fdbd3a93b08fd27eb8bf5c

Add a new error injection knob so that we can arbitrarily slow down
writeback to test for race conditions and aberrant reclaim behavior if
the writeback mechanisms are slow to issue writeback.  This will enable
functional testing for the ifork sequence counters introduced in commit
745b3f76d1c8 ("xfs: maintain a sequence count for inode fork
manipulations").

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
io/inject.c
libxfs/xfs_errortag.h

index 4f7c6fff4cd6e381fe207bb0037bd2c0bcce7042..825625b02d371b5c68703e912c355f52438d2afe 100644 (file)
@@ -61,6 +61,7 @@ error_tag(char *name)
                { XFS_ERRTAG_LARP,                      "larp" },
                { XFS_ERRTAG_DA_LEAF_SPLIT,             "da_leaf_split" },
                { XFS_ERRTAG_ATTR_LEAF_TO_NODE,         "attr_leaf_to_node" },
+               { XFS_ERRTAG_WB_DELAY_MS,               "wb_delay_ms" },
                { XFS_ERRTAG_MAX,                       NULL }
        };
        int     count;
index 580ccbd5aadc2cf18f29d69b692ce32f71e6c9cf..f5f629174ecad6b686f55d2d82cfc1e1cc4b6398 100644 (file)
@@ -61,7 +61,8 @@
 #define XFS_ERRTAG_LARP                                        39
 #define XFS_ERRTAG_DA_LEAF_SPLIT                       40
 #define XFS_ERRTAG_ATTR_LEAF_TO_NODE                   41
-#define XFS_ERRTAG_MAX                                 42
+#define XFS_ERRTAG_WB_DELAY_MS                         42
+#define XFS_ERRTAG_MAX                                 43
 
 /*
  * Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
 #define XFS_RANDOM_LARP                                        1
 #define XFS_RANDOM_DA_LEAF_SPLIT                       1
 #define XFS_RANDOM_ATTR_LEAF_TO_NODE                   1
+#define XFS_RANDOM_WB_DELAY_MS                         3000
 
 #endif /* __XFS_ERRORTAG_H_ */