summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-22 18:09:48 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2018-01-29 07:27:22 -0800
commit22431bf3dfbf44d7356933776eb486a6a01dea6f (patch)
tree5d4aecebcd8cdb86a29e317d2ddeadaff9ed4e85 /fs/xfs/xfs_inode.c
parent67a3f6d01495bbf520186aa3ecd013ba02b81462 (diff)
downloadlinux-22431bf3dfbf44d7356933776eb486a6a01dea6f.tar.bz2
xfs: refactor inode verifier corruption error printing
Refactor inode verifier error reporting into a non-libxfs function so that we aren't encoding the message format in libxfs. This also changes the kernel dmesg output to resemble buffer verifier errors more closely. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 4ea6476bcbd7..5366fb619db6 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3486,21 +3486,23 @@ bool
xfs_inode_verify_forks(
struct xfs_inode *ip)
{
+ struct xfs_ifork *ifp;
xfs_failaddr_t fa;
fa = xfs_ifork_verify_data(ip, &xfs_default_ifork_ops);
if (fa) {
- xfs_alert(ip->i_mount,
- "%s: bad inode %llu inline data fork at %pS",
- __func__, ip->i_ino, fa);
+ ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
+ xfs_inode_verifier_error(ip, -EFSCORRUPTED, "data fork",
+ ifp->if_u1.if_data, ifp->if_bytes, fa);
return false;
}
fa = xfs_ifork_verify_attr(ip, &xfs_default_ifork_ops);
if (fa) {
- xfs_alert(ip->i_mount,
- "%s: bad inode %llu inline attr fork at %pS",
- __func__, ip->i_ino, fa);
+ ifp = XFS_IFORK_PTR(ip, XFS_ATTR_FORK);
+ xfs_inode_verifier_error(ip, -EFSCORRUPTED, "attr fork",
+ ifp ? ifp->if_u1.if_data : NULL,
+ ifp ? ifp->if_bytes : 0, fa);
return false;
}
return true;