Commit 90a58f95 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: refactor inode verifier error logging

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: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 30b0984d
...@@ -1244,8 +1244,9 @@ xfs_iread_extents( ...@@ -1244,8 +1244,9 @@ xfs_iread_extents(
xfs_warn(ip->i_mount, xfs_warn(ip->i_mount,
"corrupt dinode %Lu, (btree extents).", "corrupt dinode %Lu, (btree extents).",
(unsigned long long) ip->i_ino); (unsigned long long) ip->i_ino);
XFS_CORRUPTION_ERROR(__func__, xfs_inode_verifier_error(ip, -EFSCORRUPTED,
XFS_ERRLEVEL_LOW, ip->i_mount, block); __func__, block, sizeof(*block),
__this_address);
error = -EFSCORRUPTED; error = -EFSCORRUPTED;
goto out_brelse; goto out_brelse;
} }
......
...@@ -195,8 +195,9 @@ xfs_iformat_local( ...@@ -195,8 +195,9 @@ xfs_iformat_local(
"corrupt inode %Lu (bad size %d for local fork, size = %d).", "corrupt inode %Lu (bad size %d for local fork, size = %d).",
(unsigned long long) ip->i_ino, size, (unsigned long long) ip->i_ino, size,
XFS_DFORK_SIZE(dip, ip->i_mount, whichfork)); XFS_DFORK_SIZE(dip, ip->i_mount, whichfork));
XFS_CORRUPTION_ERROR("xfs_iformat_local", XFS_ERRLEVEL_LOW, xfs_inode_verifier_error(ip, -EFSCORRUPTED,
ip->i_mount, dip); "xfs_iformat_local", dip, sizeof(*dip),
__this_address);
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
...@@ -231,8 +232,9 @@ xfs_iformat_extents( ...@@ -231,8 +232,9 @@ xfs_iformat_extents(
if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, mp, whichfork))) { if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, mp, whichfork))) {
xfs_warn(ip->i_mount, "corrupt inode %Lu ((a)extents = %d).", xfs_warn(ip->i_mount, "corrupt inode %Lu ((a)extents = %d).",
(unsigned long long) ip->i_ino, nex); (unsigned long long) ip->i_ino, nex);
XFS_CORRUPTION_ERROR("xfs_iformat_extents(1)", XFS_ERRLEVEL_LOW, xfs_inode_verifier_error(ip, -EFSCORRUPTED,
mp, dip); "xfs_iformat_extents(1)", dip, sizeof(*dip),
__this_address);
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
...@@ -309,8 +311,9 @@ xfs_iformat_btree( ...@@ -309,8 +311,9 @@ xfs_iformat_btree(
level == 0 || level > XFS_BTREE_MAXLEVELS) { level == 0 || level > XFS_BTREE_MAXLEVELS) {
xfs_warn(mp, "corrupt inode %Lu (btree).", xfs_warn(mp, "corrupt inode %Lu (btree).",
(unsigned long long) ip->i_ino); (unsigned long long) ip->i_ino);
XFS_CORRUPTION_ERROR("xfs_iformat_btree", XFS_ERRLEVEL_LOW, xfs_inode_verifier_error(ip, -EFSCORRUPTED,
mp, dip); "xfs_iformat_btree", dfp, size,
__this_address);
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment