Commit 43059d54 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: dump log intent items that cannot be recovered due to corruption



If we try to recover a log intent item and the operation fails due to
filesystem corruption, dump the contents of the item to the log for
further analysis.

Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 48c6615c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -522,6 +522,9 @@ xfs_bui_item_recover(
	error = xfs_trans_log_finish_bmap_update(tp, budp, bui_type, ip,
			whichfork, bmap->me_startoff, bmap->me_startblock,
			&count, state);
	if (error == -EFSCORRUPTED)
		XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, bmap,
				sizeof(*bmap));
	if (error)
		goto err_cancel;

+3 −0
Original line number Diff line number Diff line
@@ -629,6 +629,9 @@ xfs_efi_item_recover(
		error = xfs_trans_free_extent(tp, efdp, extp->ext_start,
					      extp->ext_len,
					      &XFS_RMAP_OINFO_ANY_OWNER, false);
		if (error == -EFSCORRUPTED)
			XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp,
					extp, sizeof(*extp));
		if (error)
			goto abort_error;

+3 −0
Original line number Diff line number Diff line
@@ -522,6 +522,9 @@ xfs_cui_item_recover(
			error = xfs_trans_log_finish_refcount_update(tp, cudp,
				type, refc->pe_startblock, refc->pe_len,
				&new_fsb, &new_len, &rcur);
		if (error == -EFSCORRUPTED)
			XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp,
					refc, sizeof(*refc));
		if (error)
			goto abort_error;

+3 −0
Original line number Diff line number Diff line
@@ -578,6 +578,9 @@ xfs_rui_item_recover(
				rmap->me_owner, whichfork,
				rmap->me_startoff, rmap->me_startblock,
				rmap->me_len, state, &rcur);
		if (error == -EFSCORRUPTED)
			XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp,
					rmap, sizeof(*rmap));
		if (error)
			goto abort_error;