]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: refactor inode verifier error logging
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 18 Apr 2018 19:46:07 +0000 (14:46 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 18 Apr 2018 19:46:07 +0000 (14:46 -0500)
Source kernel commit: 90a58f95717b46f67756580ad5f8b698304e4bad

Refactor some of the inode verifier failure logging call sites to use
the new xfs_inode_verifier_error method which dumps the offending buffer
as well as the code location of the failed check.  This trims the
output, makes it clearer to the admin that repair must be run, and gives
the developers more details to work from.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
libxfs/xfs_bmap.c
libxfs/xfs_inode_fork.c

index eca3e3da1063bfa1d58591e6fa783bd4c2fa89ff..e02fdd0d2f8050a69087a05a099ae2023b300425 100644 (file)
@@ -1235,8 +1235,9 @@ xfs_iread_extents(
                        xfs_warn(ip->i_mount,
                                "corrupt dinode %Lu, (btree extents).",
                                (unsigned long long) ip->i_ino);
-                       XFS_CORRUPTION_ERROR(__func__,
-                               XFS_ERRLEVEL_LOW, ip->i_mount, block);
+                       xfs_inode_verifier_error(ip, -EFSCORRUPTED,
+                                       __func__, block, sizeof(*block),
+                                       __this_address);
                        error = -EFSCORRUPTED;
                        goto out_brelse;
                }
index dd622d7be0a2eb78ae8df4ff6268e94050d61542..1f7cb25ee2498c806fe06da2f99d3eea1ee45bda 100644 (file)
@@ -192,8 +192,9 @@ xfs_iformat_local(
        "corrupt inode %Lu (bad size %d for local fork, size = %d).",
                        (unsigned long long) ip->i_ino, size,
                        XFS_DFORK_SIZE(dip, ip->i_mount, whichfork));
-               XFS_CORRUPTION_ERROR("xfs_iformat_local", XFS_ERRLEVEL_LOW,
-                                    ip->i_mount, dip);
+               xfs_inode_verifier_error(ip, -EFSCORRUPTED,
+                               "xfs_iformat_local", dip, sizeof(*dip),
+                               __this_address);
                return -EFSCORRUPTED;
        }
 
@@ -228,8 +229,9 @@ xfs_iformat_extents(
        if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, mp, whichfork))) {
                xfs_warn(ip->i_mount, "corrupt inode %Lu ((a)extents = %d).",
                        (unsigned long long) ip->i_ino, nex);
-               XFS_CORRUPTION_ERROR("xfs_iformat_extents(1)", XFS_ERRLEVEL_LOW,
-                                    mp, dip);
+               xfs_inode_verifier_error(ip, -EFSCORRUPTED,
+                               "xfs_iformat_extents(1)", dip, sizeof(*dip),
+                               __this_address);
                return -EFSCORRUPTED;
        }
 
@@ -306,8 +308,9 @@ xfs_iformat_btree(
                     level == 0 || level > XFS_BTREE_MAXLEVELS) {
                xfs_warn(mp, "corrupt inode %Lu (btree).",
                                        (unsigned long long) ip->i_ino);
-               XFS_CORRUPTION_ERROR("xfs_iformat_btree", XFS_ERRLEVEL_LOW,
-                                        mp, dip);
+               xfs_inode_verifier_error(ip, -EFSCORRUPTED,
+                               "xfs_iformat_btree", dfp, size,
+                               __this_address);
                return -EFSCORRUPTED;
        }