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

Add a new error injection knob so that we can arbitrarily slow down
pagecache writes 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 304a68b9c63b ("xfs: use iomap_valid method to
detect stale cached iomaps") that fixes write racing with reclaim
writeback.

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 825625b02d371b5c68703e912c355f52438d2afe..6ef1fc8d2f4bc2d657dab19a58d08f88107e22e3 100644 (file)
@@ -62,6 +62,7 @@ error_tag(char *name)
                { 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_WRITE_DELAY_MS,            "write_delay_ms" },
                { XFS_ERRTAG_MAX,                       NULL }
        };
        int     count;
index f5f629174ecad6b686f55d2d82cfc1e1cc4b6398..01a9e86b303790f82d7fce5525ef40085a4b2bb2 100644 (file)
@@ -62,7 +62,8 @@
 #define XFS_ERRTAG_DA_LEAF_SPLIT                       40
 #define XFS_ERRTAG_ATTR_LEAF_TO_NODE                   41
 #define XFS_ERRTAG_WB_DELAY_MS                         42
-#define XFS_ERRTAG_MAX                                 43
+#define XFS_ERRTAG_WRITE_DELAY_MS                      43
+#define XFS_ERRTAG_MAX                                 44
 
 /*
  * Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
 #define XFS_RANDOM_DA_LEAF_SPLIT                       1
 #define XFS_RANDOM_ATTR_LEAF_TO_NODE                   1
 #define XFS_RANDOM_WB_DELAY_MS                         3000
+#define XFS_RANDOM_WRITE_DELAY_MS                      3000
 
 #endif /* __XFS_ERRORTAG_H_ */