From: Ryusuke Konishi Date: Tue, 7 Apr 2009 02:01:55 +0000 (-0700) Subject: nilfs2: super block operations fix endian bug X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e62687468588f47c32256e3c8c36157c40111b6e;p=linux-2.6-omap-h63xx.git nilfs2: super block operations fix endian bug 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index d0639a6aae9..b7519c327ba 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); }