aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-03-15 15:53:19 +0100
committerCarlos Maiolino <cem@kernel.org>2023-03-17 11:38:46 +0100
commit9061d756bce1322282fd3a99b065392daed136b5 (patch)
tree3b48fc68ccccfd8df8c020bf6d0c7d603ffbd6cb
parentd712be6a982bcf19b778e01c70368506a8f26a68 (diff)
downloadxfsprogs-dev-9061d756bce1322282fd3a99b065392daed136b5.tar.gz
xfs: add debug knob to slow down writeback for fun
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>
-rw-r--r--io/inject.c1
-rw-r--r--libxfs/xfs_errortag.h4
2 files changed, 4 insertions, 1 deletions
diff --git a/io/inject.c b/io/inject.c
index 4f7c6fff4c..825625b02d 100644
--- a/io/inject.c
+++ b/io/inject.c
@@ -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;
diff --git a/libxfs/xfs_errortag.h b/libxfs/xfs_errortag.h
index 580ccbd5aa..f5f629174e 100644
--- a/libxfs/xfs_errortag.h
+++ b/libxfs/xfs_errortag.h
@@ -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.
@@ -107,5 +108,6 @@
#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_ */