From: Darrick J. Wong Date: Wed, 15 Mar 2023 14:55:23 +0000 (+0100) Subject: xfs: add debug knob to slow down write for fun X-Git-Tag: v6.2.0~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb084f350b18ce329d6e170e1b94a66f8ec44882;p=thirdparty%2Fxfsprogs-dev.git xfs: add debug knob to slow down write for fun 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 Reviewed-by: Dave Chinner Signed-off-by: Carlos Maiolino --- diff --git a/io/inject.c b/io/inject.c index 825625b02..6ef1fc8d2 100644 --- a/io/inject.c +++ b/io/inject.c @@ -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; diff --git a/libxfs/xfs_errortag.h b/libxfs/xfs_errortag.h index f5f629174..01a9e86b3 100644 --- a/libxfs/xfs_errortag.h +++ b/libxfs/xfs_errortag.h @@ -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. @@ -109,5 +110,6 @@ #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_ */