summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-01-05 17:45:52 -0800
committerDarrick J. Wong <djwong@kernel.org>2021-03-25 17:08:42 -0700
commite2d6ef03e4a88aa24ab6aa1d1e590674fee36592 (patch)
treea3bd5ae8e9d1645a10e6cc2fe7cad930b433d785
parente30ebfab29b769243b8bcf67c2cd6bf568e4d5c4 (diff)
xfs: support error injection when freeing rt extentsrealtime-extfree-intents_2021-03-25
A handful of fstests expect to be able to test what happens when extent free intents fail to actually free the extent. Now that we're supporting EFIs for realtime extents, add to xfs_rtfree_extent the same injection point that exists in the regular extent freeing code. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index 23fcd8b25903..4bbc5e371a26 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -17,6 +17,7 @@
#include "xfs_rtalloc.h"
#include "xfs_error.h"
#include "xfs_health.h"
+#include "xfs_errortag.h"
/*
* Realtime allocator bitmap functions shared with userspace.
@@ -983,6 +984,9 @@ xfs_rtfree_extent(
ASSERT(mp->m_rbmip->i_itemp != NULL);
ASSERT(xfs_isilocked(mp->m_rbmip, XFS_ILOCK_EXCL));
+ if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_FREE_EXTENT))
+ return -EIO;
+
error = xfs_rtcheck_alloc_range(mp, tp, bno, len);
if (error)
return error;