aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-03-23 13:06:52 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-03-23 21:05:07 -0400
commit90a58f95717b46f67756580ad5f8b698304e4bad (patch)
tree0efe6b26ced2ce6fd36b00829dde914a5e816e2b
parent30b0984d9117dd14c895265886d34335856b712b (diff)
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: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c5
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.c15
2 files changed, 12 insertions, 8 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 91214f21563c..3b03d886df66 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -1244,8 +1244,9 @@ xfs_iread_extents(
1244 xfs_warn(ip->i_mount, 1244 xfs_warn(ip->i_mount,
1245 "corrupt dinode %Lu, (btree extents).", 1245 "corrupt dinode %Lu, (btree extents).",
1246 (unsigned long long) ip->i_ino); 1246 (unsigned long long) ip->i_ino);
1247 XFS_CORRUPTION_ERROR(__func__, 1247 xfs_inode_verifier_error(ip, -EFSCORRUPTED,
1248 XFS_ERRLEVEL_LOW, ip->i_mount, block); 1248 __func__, block, sizeof(*block),
1249 __this_address);
1249 error = -EFSCORRUPTED; 1250 error = -EFSCORRUPTED;
1250 goto out_brelse; 1251 goto out_brelse;
1251 } 1252 }
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
index 613fba22ae4e..701c42a28d05 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.c
+++ b/fs/xfs/libxfs/xfs_inode_fork.c
@@ -195,8 +195,9 @@ xfs_iformat_local(
195 "corrupt inode %Lu (bad size %d for local fork, size = %d).", 195 "corrupt inode %Lu (bad size %d for local fork, size = %d).",
196 (unsigned long long) ip->i_ino, size, 196 (unsigned long long) ip->i_ino, size,
197 XFS_DFORK_SIZE(dip, ip->i_mount, whichfork)); 197 XFS_DFORK_SIZE(dip, ip->i_mount, whichfork));
198 XFS_CORRUPTION_ERROR("xfs_iformat_local", XFS_ERRLEVEL_LOW, 198 xfs_inode_verifier_error(ip, -EFSCORRUPTED,
199 ip->i_mount, dip); 199 "xfs_iformat_local", dip, sizeof(*dip),
200 __this_address);
200 return -EFSCORRUPTED; 201 return -EFSCORRUPTED;
201 } 202 }
202 203
@@ -231,8 +232,9 @@ xfs_iformat_extents(
231 if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, mp, whichfork))) { 232 if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, mp, whichfork))) {
232 xfs_warn(ip->i_mount, "corrupt inode %Lu ((a)extents = %d).", 233 xfs_warn(ip->i_mount, "corrupt inode %Lu ((a)extents = %d).",
233 (unsigned long long) ip->i_ino, nex); 234 (unsigned long long) ip->i_ino, nex);
234 XFS_CORRUPTION_ERROR("xfs_iformat_extents(1)", XFS_ERRLEVEL_LOW, 235 xfs_inode_verifier_error(ip, -EFSCORRUPTED,
235 mp, dip); 236 "xfs_iformat_extents(1)", dip, sizeof(*dip),
237 __this_address);
236 return -EFSCORRUPTED; 238 return -EFSCORRUPTED;
237 } 239 }
238 240
@@ -309,8 +311,9 @@ xfs_iformat_btree(
309 level == 0 || level > XFS_BTREE_MAXLEVELS) { 311 level == 0 || level > XFS_BTREE_MAXLEVELS) {
310 xfs_warn(mp, "corrupt inode %Lu (btree).", 312 xfs_warn(mp, "corrupt inode %Lu (btree).",
311 (unsigned long long) ip->i_ino); 313 (unsigned long long) ip->i_ino);
312 XFS_CORRUPTION_ERROR("xfs_iformat_btree", XFS_ERRLEVEL_LOW, 314 xfs_inode_verifier_error(ip, -EFSCORRUPTED,
313 mp, dip); 315 "xfs_iformat_btree", dfp, size,
316 __this_address);
314 return -EFSCORRUPTED; 317 return -EFSCORRUPTED;
315 } 318 }
316 319