xfs: dump the recovered xattri log item if corruption happens
authorDarrick J. Wong <djwong@kernel.org>
Thu, 30 Nov 2023 17:57:42 +0000 (09:57 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 7 Dec 2023 02:45:15 +0000 (18:45 -0800)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_attr_item.c

index c4441eacf51c7feecbf17f9c142682e71303c1d2..c7c308d2f8973bbf37169b16d671a4926dbd0a2f 100644 (file)
@@ -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;