lkml.org 
[lkml]   [2009]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -mm 1/5] nilfs2: super block operations fix endian bug
Date
This adds a missing endian conversion of checksum field in the super
block. This fixes compatibility issue on big endian machines which
will come to surface after supporting recovery of super block.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
fs/nilfs2/super.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index d0639a6..b7519c3 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -287,9 +287,9 @@ int nilfs_commit_super(struct nilfs_sb_info *sbi)
sbp->s_free_blocks_count = cpu_to_le64(nfreeblocks);
sbp->s_wtime = cpu_to_le64(get_seconds());
sbp->s_sum = 0;
- sbp->s_sum = crc32_le(nilfs->ns_crc_seed, (unsigned char *)sbp,
- le16_to_cpu(sbp->s_bytes));
-
+ sbp->s_sum = cpu_to_le32(crc32_le(nilfs->ns_crc_seed,
+ (unsigned char *)sbp,
+ le16_to_cpu(sbp->s_bytes)));
sbi->s_super->s_dirt = 0;
return nilfs_sync_super(sbi);
}
--
1.5.6.5


\
 
 \ /
  Last update: 2009-03-05 17:15    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site