Commit e2a64192 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: corruption needs to respect endianess too!

At least if we want to be able to recognize the pattern.  Add a missing
byte swap to the corruption injection case in xlog_sync.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent ef2b67ec
...@@ -1852,7 +1852,7 @@ xlog_sync( ...@@ -1852,7 +1852,7 @@ xlog_sync(
*/ */
if (log->l_badcrc_factor && if (log->l_badcrc_factor &&
(prandom_u32() % log->l_badcrc_factor == 0)) { (prandom_u32() % log->l_badcrc_factor == 0)) {
iclog->ic_header.h_crc &= 0xAAAAAAAA; iclog->ic_header.h_crc &= cpu_to_le32(0xAAAAAAAA);
iclog->ic_state |= XLOG_STATE_IOABORT; iclog->ic_state |= XLOG_STATE_IOABORT;
xfs_warn(log->l_mp, xfs_warn(log->l_mp,
"Intentionally corrupted log record at LSN 0x%llx. Shutdown imminent.", "Intentionally corrupted log record at LSN 0x%llx. Shutdown imminent.",
......
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