aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-02-07 19:03:58 -0500
committerroot <root@disappointment.disaster>2016-02-07 19:03:58 -0500
commit8e0bd4925bf693520295de403483efad4dc5cc16 (patch)
tree746400338dc8354894ea40f95bddee38400af84d /fs/xfs
parent36f90b0a2ddd60823fe193a85e60ff1906c2a9b3 (diff)
xfs: fix endianness error when checking log block crc on big endian platforms
Since the checksum function and the field are both __le32, don't perform endian conversion when comparing the two. This fixes mount failures on ppc64. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_log_recover.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index da37beb76f6e..594f7e63b432 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -4491,7 +4491,7 @@ xlog_recover_process(
4491 * know precisely what failed. 4491 * know precisely what failed.
4492 */ 4492 */
4493 if (pass == XLOG_RECOVER_CRCPASS) { 4493 if (pass == XLOG_RECOVER_CRCPASS) {
4494 if (rhead->h_crc && crc != le32_to_cpu(rhead->h_crc)) 4494 if (rhead->h_crc && crc != rhead->h_crc)
4495 return -EFSBADCRC; 4495 return -EFSBADCRC;
4496 return 0; 4496 return 0;
4497 } 4497 }
@@ -4502,7 +4502,7 @@ xlog_recover_process(
4502 * zero CRC check prevents warnings from being emitted when upgrading 4502 * zero CRC check prevents warnings from being emitted when upgrading
4503 * the kernel from one that does not add CRCs by default. 4503 * the kernel from one that does not add CRCs by default.
4504 */ 4504 */
4505 if (crc != le32_to_cpu(rhead->h_crc)) { 4505 if (crc != rhead->h_crc) {
4506 if (rhead->h_crc || xfs_sb_version_hascrc(&log->l_mp->m_sb)) { 4506 if (rhead->h_crc || xfs_sb_version_hascrc(&log->l_mp->m_sb)) {
4507 xfs_alert(log->l_mp, 4507 xfs_alert(log->l_mp,
4508 "log record CRC mismatch: found 0x%x, expected 0x%x.", 4508 "log record CRC mismatch: found 0x%x, expected 0x%x.",