Commit 9c712a13 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: dump the first 128 bytes of any corrupt buffer

Increase the corrupt buffer dump to the first 128 bytes since v5
filesystems have larger block headers than before.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent d9418ed0
...@@ -1381,7 +1381,8 @@ _xfs_buf_ioapply( ...@@ -1381,7 +1381,8 @@ _xfs_buf_ioapply(
xfs_warn(mp, xfs_warn(mp,
"%s: no ops on block 0x%llx/0x%x", "%s: no ops on block 0x%llx/0x%x",
__func__, bp->b_bn, bp->b_length); __func__, bp->b_bn, bp->b_length);
xfs_hex_dump(bp->b_addr, 64); xfs_hex_dump(bp->b_addr,
XFS_CORRUPTION_DUMP_LEN);
dump_stack(); dump_stack();
} }
} }
......
...@@ -336,7 +336,7 @@ xfs_corruption_error( ...@@ -336,7 +336,7 @@ xfs_corruption_error(
xfs_failaddr_t failaddr) xfs_failaddr_t failaddr)
{ {
if (level <= xfs_error_level) if (level <= xfs_error_level)
xfs_hex_dump(p, 64); xfs_hex_dump(p, XFS_CORRUPTION_DUMP_LEN);
xfs_error_report(tag, level, mp, filename, linenum, failaddr); xfs_error_report(tag, level, mp, filename, linenum, failaddr);
xfs_alert(mp, "Corruption detected. Unmount and run xfs_repair"); xfs_alert(mp, "Corruption detected. Unmount and run xfs_repair");
} }
...@@ -364,8 +364,9 @@ xfs_verifier_error( ...@@ -364,8 +364,9 @@ xfs_verifier_error(
xfs_alert(mp, "Unmount and run xfs_repair"); xfs_alert(mp, "Unmount and run xfs_repair");
if (xfs_error_level >= XFS_ERRLEVEL_LOW) { if (xfs_error_level >= XFS_ERRLEVEL_LOW) {
xfs_alert(mp, "First 64 bytes of corrupted metadata buffer:"); xfs_alert(mp, "First %d bytes of corrupted metadata buffer:",
xfs_hex_dump(xfs_buf_offset(bp, 0), 64); XFS_CORRUPTION_DUMP_LEN);
xfs_hex_dump(xfs_buf_offset(bp, 0), XFS_CORRUPTION_DUMP_LEN);
} }
if (xfs_error_level >= XFS_ERRLEVEL_HIGH) if (xfs_error_level >= XFS_ERRLEVEL_HIGH)
......
...@@ -39,6 +39,9 @@ extern void xfs_verifier_error(struct xfs_buf *bp, int error, ...@@ -39,6 +39,9 @@ extern void xfs_verifier_error(struct xfs_buf *bp, int error,
#define XFS_ERRLEVEL_LOW 1 #define XFS_ERRLEVEL_LOW 1
#define XFS_ERRLEVEL_HIGH 5 #define XFS_ERRLEVEL_HIGH 5
/* Dump 128 bytes of any corrupt buffer */
#define XFS_CORRUPTION_DUMP_LEN (128)
/* /*
* Macros to set EFSCORRUPTED & return/branch. * Macros to set EFSCORRUPTED & return/branch.
*/ */
......
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