Commit e6268746 authored by Ryusuke Konishi's avatar Ryusuke Konishi Committed by Linus Torvalds

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: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1f5abe7e
...@@ -287,9 +287,9 @@ int nilfs_commit_super(struct nilfs_sb_info *sbi) ...@@ -287,9 +287,9 @@ int nilfs_commit_super(struct nilfs_sb_info *sbi)
sbp->s_free_blocks_count = cpu_to_le64(nfreeblocks); sbp->s_free_blocks_count = cpu_to_le64(nfreeblocks);
sbp->s_wtime = cpu_to_le64(get_seconds()); sbp->s_wtime = cpu_to_le64(get_seconds());
sbp->s_sum = 0; sbp->s_sum = 0;
sbp->s_sum = crc32_le(nilfs->ns_crc_seed, (unsigned char *)sbp, sbp->s_sum = cpu_to_le32(crc32_le(nilfs->ns_crc_seed,
le16_to_cpu(sbp->s_bytes)); (unsigned char *)sbp,
le16_to_cpu(sbp->s_bytes)));
sbi->s_super->s_dirt = 0; sbi->s_super->s_dirt = 0;
return nilfs_sync_super(sbi); return nilfs_sync_super(sbi);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment