diff mbox series

[6/8] xfs: dump the recovered xattri log item if corruption happens

Message ID 170162989802.3037528.5252429066673340449.stgit@frogsfrogsfrogs (mailing list archive)
State Superseded
Headers show
Series xfs: log intent item recovery should reconstruct defer work state | expand

Commit Message

Darrick J. Wong Dec. 3, 2023, 7:02 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

If xfs_attri_item_recover receives a corruption error when it tries to
finish a recovered log intent item, it should dump the log item for
debugging, just like all the other log intent items.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/xfs_attr_item.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Christoph Hellwig Dec. 4, 2023, 5:05 a.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
index c4441eacf51c..c7c308d2f897 100644
--- a/fs/xfs/xfs_attr_item.c
+++ b/fs/xfs/xfs_attr_item.c
@@ -666,6 +666,10 @@  xfs_attri_item_recover(
 		xfs_irele(ip);
 		return 0;
 	}
+	if (error == -EFSCORRUPTED)
+		XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp,
+				&attrip->attri_format,
+				sizeof(attrip->attri_format));
 	if (error) {
 		xfs_trans_cancel(tp);
 		goto out_unlock;