From: Christoph Hellwig Date: Fri, 21 Apr 2017 18:24:40 +0000 (-0700) Subject: xfs: corruption needs to respect endianess too! X-Git-Tag: v4.12-rc1~76^2~13 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e2a641922a3592b5ea226624d5abeb13eb49622c;p=karo-tx-linux.git 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: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index bb58cd1873c9..3731f13f63e9 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -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.",