summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:15:27 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-11-09 19:08:00 -0800
commit0718a6f5ab899ad96d8d699b67c51d89b7f7398e (patch)
tree1cc3d0323aded041330def3a81c127f71e650850
parent0559ac6715264a524ffb84b62021ecde383d26b6 (diff)
xfs: support error injection when freeing rt extentsrealtime-extfree-intents_2022-11-09
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 ccefbfc70f8b..a4cd7925492d 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -20,6 +20,7 @@
#include "xfs_rtbitmap.h"
#include "xfs_log.h"
#include "xfs_buf_item.h"
+#include "xfs_errortag.h"
/*
* Realtime allocator bitmap functions shared with userspace.
@@ -1139,6 +1140,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, start, len);
if (error)
return error;