From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6C9FE7CA3 for ; Tue, 26 Jan 2016 13:49:29 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 5D4818F804C for ; Tue, 26 Jan 2016 11:49:29 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 2Fkjo6kihHajhYPk (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 26 Jan 2016 11:49:28 -0800 (PST) Date: Tue, 26 Jan 2016 14:49:26 -0500 From: Brian Foster Subject: Re: [PATCH v2] xfs: fix endianness error when checking log block crc on big endian platforms Message-ID: <20160126194925.GB54800@bfoster.bfoster> References: <20160126192105.GB6757@birch.djwong.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160126192105.GB6757@birch.djwong.org> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: "Darrick J. Wong" Cc: Eric Sandeen , xfs On Tue, Jan 26, 2016 at 11:21:05AM -0800, Darrick J. Wong wrote: > 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. > > v2: fix the other crc comparison > > Signed-off-by: Darrick J. Wong > --- Thanks! Reviewed-by: Brian Foster > fs/xfs/xfs_log_recover.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index da37beb..594f7e6 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -4491,7 +4491,7 @@ xlog_recover_process( > * know precisely what failed. > */ > if (pass == XLOG_RECOVER_CRCPASS) { > - if (rhead->h_crc && crc != le32_to_cpu(rhead->h_crc)) > + if (rhead->h_crc && crc != rhead->h_crc) > return -EFSBADCRC; > return 0; > } > @@ -4502,7 +4502,7 @@ xlog_recover_process( > * zero CRC check prevents warnings from being emitted when upgrading > * the kernel from one that does not add CRCs by default. > */ > - if (crc != le32_to_cpu(rhead->h_crc)) { > + if (crc != rhead->h_crc) { > if (rhead->h_crc || xfs_sb_version_hascrc(&log->l_mp->m_sb)) { > xfs_alert(log->l_mp, > "log record CRC mismatch: found 0x%x, expected 0x%x.", > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs