aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-27 21:01:03 -0500
committerBen Myers <bpm@sgi.com>2012-12-03 13:10:59 -0500
commitf9668a09e32ac6d2aa22f44cc310e430a8f4a40f (patch)
treefa17dca528099f33b92b8a8d5018e59628e9bc90 /fs/xfs/xfs_log_recover.c
parentb870553cdecb26d5291af09602352b763e323df2 (diff)
xfs: fix sparse reported log CRC endian issue
Not a bug as such, just warning noise from the xlog_cksum() returning a __be32 type when it should be returning a __le32 type. On Wed, Nov 28, 2012 at 08:30:59AM -0500, Christoph Hellwig wrote: > But why are we storing the crc field little endian while all other on > disk formats are big endian? (And yes I realize it might as well have > been me who did that back in the idea, but I still have no idea why) Because the CRC always returns the calcuation LE format, even on BE systems. So rather than always having to byte swap it everywhere and have all the force casts and anootations for sparse, it seems simpler to just make it a __le32 everywhere.... Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ben Myers <bpm@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 9c3651c9e75b..96fcbb85ff83 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -3233,15 +3233,15 @@ xlog_unpack_data_crc(
3233 xfs_caddr_t dp, 3233 xfs_caddr_t dp,
3234 struct xlog *log) 3234 struct xlog *log)
3235{ 3235{
3236 __be32 crc; 3236 __le32 crc;
3237 3237
3238 crc = xlog_cksum(log, rhead, dp, be32_to_cpu(rhead->h_len)); 3238 crc = xlog_cksum(log, rhead, dp, be32_to_cpu(rhead->h_len));
3239 if (crc != rhead->h_crc) { 3239 if (crc != rhead->h_crc) {
3240 if (rhead->h_crc || xfs_sb_version_hascrc(&log->l_mp->m_sb)) { 3240 if (rhead->h_crc || xfs_sb_version_hascrc(&log->l_mp->m_sb)) {
3241 xfs_alert(log->l_mp, 3241 xfs_alert(log->l_mp,
3242 "log record CRC mismatch: found 0x%x, expected 0x%x.\n", 3242 "log record CRC mismatch: found 0x%x, expected 0x%x.\n",
3243 be32_to_cpu(rhead->h_crc), 3243 le32_to_cpu(rhead->h_crc),
3244 be32_to_cpu(crc)); 3244 le32_to_cpu(crc));
3245 xfs_hex_dump(dp, 32); 3245 xfs_hex_dump(dp, 32);
3246 } 3246 }
3247 3247