diff options
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r-- | fs/f2fs/segment.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 429007b8036e..b74602813a05 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h | |||
@@ -109,7 +109,7 @@ | |||
109 | #define START_SEGNO(segno) \ | 109 | #define START_SEGNO(segno) \ |
110 | (SIT_BLOCK_OFFSET(segno) * SIT_ENTRY_PER_BLOCK) | 110 | (SIT_BLOCK_OFFSET(segno) * SIT_ENTRY_PER_BLOCK) |
111 | #define SIT_BLK_CNT(sbi) \ | 111 | #define SIT_BLK_CNT(sbi) \ |
112 | ((MAIN_SEGS(sbi) + SIT_ENTRY_PER_BLOCK - 1) / SIT_ENTRY_PER_BLOCK) | 112 | DIV_ROUND_UP(MAIN_SEGS(sbi), SIT_ENTRY_PER_BLOCK) |
113 | #define f2fs_bitmap_size(nr) \ | 113 | #define f2fs_bitmap_size(nr) \ |
114 | (BITS_TO_LONGS(nr) * sizeof(unsigned long)) | 114 | (BITS_TO_LONGS(nr) * sizeof(unsigned long)) |
115 | 115 | ||
@@ -693,21 +693,19 @@ static inline int check_block_count(struct f2fs_sb_info *sbi, | |||
693 | } while (cur_pos < sbi->blocks_per_seg); | 693 | } while (cur_pos < sbi->blocks_per_seg); |
694 | 694 | ||
695 | if (unlikely(GET_SIT_VBLOCKS(raw_sit) != valid_blocks)) { | 695 | if (unlikely(GET_SIT_VBLOCKS(raw_sit) != valid_blocks)) { |
696 | f2fs_msg(sbi->sb, KERN_ERR, | 696 | f2fs_err(sbi, "Mismatch valid blocks %d vs. %d", |
697 | "Mismatch valid blocks %d vs. %d", | 697 | GET_SIT_VBLOCKS(raw_sit), valid_blocks); |
698 | GET_SIT_VBLOCKS(raw_sit), valid_blocks); | ||
699 | set_sbi_flag(sbi, SBI_NEED_FSCK); | 698 | set_sbi_flag(sbi, SBI_NEED_FSCK); |
700 | return -EINVAL; | 699 | return -EFSCORRUPTED; |
701 | } | 700 | } |
702 | 701 | ||
703 | /* check segment usage, and check boundary of a given segment number */ | 702 | /* check segment usage, and check boundary of a given segment number */ |
704 | if (unlikely(GET_SIT_VBLOCKS(raw_sit) > sbi->blocks_per_seg | 703 | if (unlikely(GET_SIT_VBLOCKS(raw_sit) > sbi->blocks_per_seg |
705 | || segno > TOTAL_SEGS(sbi) - 1)) { | 704 | || segno > TOTAL_SEGS(sbi) - 1)) { |
706 | f2fs_msg(sbi->sb, KERN_ERR, | 705 | f2fs_err(sbi, "Wrong valid blocks %d or segno %u", |
707 | "Wrong valid blocks %d or segno %u", | 706 | GET_SIT_VBLOCKS(raw_sit), segno); |
708 | GET_SIT_VBLOCKS(raw_sit), segno); | ||
709 | set_sbi_flag(sbi, SBI_NEED_FSCK); | 707 | set_sbi_flag(sbi, SBI_NEED_FSCK); |
710 | return -EINVAL; | 708 | return -EFSCORRUPTED; |
711 | } | 709 | } |
712 | return 0; | 710 | return 0; |
713 | } | 711 | } |