@@ -63,6 +63,7 @@ error_tag(char *name)
{ 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_SWAPEXT_FINISH_ONE, "swapext_finish_one" },
{ XFS_ERRTAG_MAX, NULL }
};
int count;
@@ -63,7 +63,8 @@
#define XFS_ERRTAG_ATTR_LEAF_TO_NODE 41
#define XFS_ERRTAG_WB_DELAY_MS 42
#define XFS_ERRTAG_WRITE_DELAY_MS 43
-#define XFS_ERRTAG_MAX 44
+#define XFS_ERRTAG_SWAPEXT_FINISH_ONE 44
+#define XFS_ERRTAG_MAX 45
/*
* Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
@@ -111,5 +112,6 @@
#define XFS_RANDOM_ATTR_LEAF_TO_NODE 1
#define XFS_RANDOM_WB_DELAY_MS 3000
#define XFS_RANDOM_WRITE_DELAY_MS 3000
+#define XFS_RANDOM_SWAPEXT_FINISH_ONE 1
#endif /* __XFS_ERRORTAG_H_ */
@@ -21,6 +21,7 @@
#include "xfs_quota_defs.h"
#include "xfs_health.h"
#include "defer_item.h"
+#include "xfs_errortag.h"
struct kmem_cache *xfs_swapext_intent_cache;
@@ -433,6 +434,9 @@ xfs_swapext_finish_one(
return error;
}
+ if (XFS_TEST_ERROR(false, tp->t_mountp, XFS_ERRTAG_SWAPEXT_FINISH_ONE))
+ return -EIO;
+
/* If we still have work to do, ask for a new transaction. */
if (sxi_has_more_swap_work(sxi) || sxi_has_postop_work(sxi)) {
trace_xfs_swapext_defer(tp->t_mountp, sxi);