]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
xfs: corruption needs to respect endianess too!
authorChristoph Hellwig <hch@lst.de>
Fri, 21 Apr 2017 18:24:40 +0000 (11:24 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Apr 2017 16:40:42 +0000 (09:40 -0700)
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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_log.c

index bb58cd1873c9b2eba1ac9180d85548c22abbdff5..3731f13f63e982e50c0342ec7550c3e6e0a1294b 100644 (file)
@@ -1852,7 +1852,7 @@ xlog_sync(
         */
        if (log->l_badcrc_factor &&
            (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;
                xfs_warn(log->l_mp,
        "Intentionally corrupted log record at LSN 0x%llx. Shutdown imminent.",