checkpoint.c (55523519bc7227e651fd4febeb3aafdd22b8af1c) | checkpoint.c (ced2c7ea8e99b46755a270872cd5ba61c27cffad) |
---|---|
1/* 2 * fs/f2fs/checkpoint.c 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 669 unchanged lines hidden (view full) --- 678 679 crc_offset = le32_to_cpu((*cp_block)->checksum_offset); 680 if (crc_offset >= blk_size) { 681 f2fs_msg(sbi->sb, KERN_WARNING, 682 "invalid crc_offset: %zu", crc_offset); 683 return -EINVAL; 684 } 685 | 1/* 2 * fs/f2fs/checkpoint.c 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 669 unchanged lines hidden (view full) --- 678 679 crc_offset = le32_to_cpu((*cp_block)->checksum_offset); 680 if (crc_offset >= blk_size) { 681 f2fs_msg(sbi->sb, KERN_WARNING, 682 "invalid crc_offset: %zu", crc_offset); 683 return -EINVAL; 684 } 685 |
686 crc = le32_to_cpu(*((__le32 *)((unsigned char *)*cp_block 687 + crc_offset))); | 686 crc = cur_cp_crc(*cp_block); |
688 if (!f2fs_crc_valid(sbi, crc, *cp_block, crc_offset)) { 689 f2fs_msg(sbi->sb, KERN_WARNING, "invalid crc value"); 690 return -EINVAL; 691 } 692 693 *version = cur_cp_version(*cp_block); 694 return 0; 695} --- 669 unchanged lines hidden --- | 687 if (!f2fs_crc_valid(sbi, crc, *cp_block, crc_offset)) { 688 f2fs_msg(sbi->sb, KERN_WARNING, "invalid crc value"); 689 return -EINVAL; 690 } 691 692 *version = cur_cp_version(*cp_block); 693 return 0; 694} --- 669 unchanged lines hidden --- |