Skip to content

Commit fc91d94

Browse files
author
Darrick J. Wong
committed
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>
1 parent 4c8900b commit fc91d94

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/xfs/libxfs/xfs_rtbitmap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "xfs_rtbitmap.h"
2222
#include "xfs_health.h"
2323
#include "xfs_sb.h"
24+
#include "xfs_errortag.h"
2425
#include "xfs_log.h"
2526
#include "xfs_buf_item.h"
2627

@@ -1065,6 +1066,9 @@ xfs_rtfree_extent(
10651066
ASSERT(rbmip->i_itemp != NULL);
10661067
xfs_assert_ilocked(rbmip, XFS_ILOCK_EXCL);
10671068

1069+
if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_FREE_EXTENT))
1070+
return -EIO;
1071+
10681072
error = xfs_rtcheck_alloc_range(&args, start, len);
10691073
if (error)
10701074
return error;

0 commit comments

Comments
 (0)