xfs: explicitly pass buffer size to xfs_corruption_error

Explicitly pass the buffer length to xfs_corruption_error() instead of
assuming XFS_CORRUPTION_DUMP_LEN so that we avoid dumping off the end
of the buffer.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
Darrick J. Wong
2018-06-04 10:23:54 -07:00
parent 85ae01098c
commit 2551a53053
9 changed files with 31 additions and 19 deletions

View File

@@ -334,13 +334,14 @@ xfs_corruption_error(
const char *tag,
int level,
struct xfs_mount *mp,
void *p,
void *buf,
size_t bufsize,
const char *filename,
int linenum,
xfs_failaddr_t failaddr)
{
if (level <= xfs_error_level)
xfs_hex_dump(p, XFS_CORRUPTION_DUMP_LEN);
xfs_hex_dump(buf, bufsize);
xfs_error_report(tag, level, mp, filename, linenum, failaddr);
xfs_alert(mp, "Corruption detected. Unmount and run xfs_repair");
}