fsck.f2fs: swap checkpoint crc to CPU endian
authorSheng Yong <shengyong1@huawei.com>
Thu, 14 Jan 2016 09:13:04 +0000 (09:13 +0000)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 14 Jan 2016 23:57:06 +0000 (15:57 -0800)
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/mount.c

index b01230f..002a7cb 100644 (file)
@@ -390,7 +390,7 @@ void *validate_checkpoint(struct f2fs_sb_info *sbi, block_t cp_addr,
        if (crc_offset >= blk_size)
                goto invalid_cp1;
 
-       crc = *(unsigned int *)((unsigned char *)cp + crc_offset);
+       crc = le32_to_cpu(*(__le32 *)((unsigned char *)cp + crc_offset));
        if (f2fs_crc_valid(crc, cp, crc_offset))
                goto invalid_cp1;
 
@@ -408,7 +408,7 @@ void *validate_checkpoint(struct f2fs_sb_info *sbi, block_t cp_addr,
        if (crc_offset >= blk_size)
                goto invalid_cp2;
 
-       crc = *(unsigned int *)((unsigned char *)cp + crc_offset);
+       crc = le32_to_cpu(*(__le32 *)((unsigned char *)cp + crc_offset));
        if (f2fs_crc_valid(crc, cp, crc_offset))
                goto invalid_cp2;