diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-04-15 14:54:19 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-04-15 14:54:19 -0700 |
commit | 5fd022ec7d420dfca1eaaf997923a5d4dd0dcf62 (patch) | |
tree | b02bec719ec4c022d43fb806744d83fb4b29934b /fs/xfs/libxfs/xfs_exchmaps.c | |
parent | 42672471f938cdab2573f32ce23915b78f0578f4 (diff) |
xfs: add error injection to test file mapping exchange recovery
Add an errortag so that we can test recovery of exchmaps log items.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_exchmaps.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_exchmaps.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_exchmaps.c b/fs/xfs/libxfs/xfs_exchmaps.c index b8e9450cc175..3b1f29e95fea 100644 --- a/fs/xfs/libxfs/xfs_exchmaps.c +++ b/fs/xfs/libxfs/xfs_exchmaps.c @@ -437,6 +437,9 @@ xfs_exchmaps_finish_one( return error; } + if (XFS_TEST_ERROR(false, tp->t_mountp, XFS_ERRTAG_EXCHMAPS_FINISH_ONE)) + return -EIO; + /* If we still have work to do, ask for a new transaction. */ if (xmi_has_more_exchange_work(xmi) || xmi_has_postop_work(xmi)) { trace_xfs_exchmaps_defer(tp->t_mountp, xmi); |