summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-11-03 20:19:27 -0800
committerDarrick J. Wong <djwong@kernel.org>2024-11-05 13:38:42 -0800
commitfc91d9430e5dd2008ef6c1350fa15c1a0ed17f11 (patch)
tree1cd90ef912389b4c0f859ce96f1d65a15fe90aaa
parent4c8900bbf106592ce647285e308abd2a7f080d88 (diff)
downloadlinux-fc91d9430e5dd2008ef6c1350fa15c1a0ed17f11.tar.gz
linux-fc91d9430e5dd2008ef6c1350fa15c1a0ed17f11.tar.bz2
linux-fc91d9430e5dd2008ef6c1350fa15c1a0ed17f11.zip
xfs: support error injection when freeing rt extents
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> Reviewed-by: Christoph Hellwig <hch@lst.de>
-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 cae0b22397d0..c73826aa4425 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -21,6 +21,7 @@
#include "xfs_rtbitmap.h"
#include "xfs_health.h"
#include "xfs_sb.h"
+#include "xfs_errortag.h"
#include "xfs_log.h"
#include "xfs_buf_item.h"
@@ -1065,6 +1066,9 @@ xfs_rtfree_extent(
ASSERT(rbmip->i_itemp != NULL);
xfs_assert_ilocked(rbmip, XFS_ILOCK_EXCL);
+ if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_FREE_EXTENT))
+ return -EIO;
+
error = xfs_rtcheck_alloc_range(&args, start, len);
if (error)
return error;