aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorYunlong Song <yunlong.song@huawei.com>2017-08-04 17:07:15 +0800
committerMister Oyster <oysterized@gmail.com>2017-10-04 15:32:36 +0200
commitdf547bfceda4e17af41d2bbb54a4debef9d0860c (patch)
tree3e8665d6f41f395f7c5bf04ae0a045a30607393c /fs
parentf1f9f13fefb340668d293549de44bd77b88d14a1 (diff)
f2fs: fix the size value in __check_sit_bitmap
The current size value is not correct and will miss bitmap check. Signed-off-by: Yunlong Song <yunlong.song@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/segment.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 7026ba37a..df78e012e 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -906,11 +906,14 @@ void __check_sit_bitmap(struct f2fs_sb_info *sbi,
sentry = get_seg_entry(sbi, segno);
offset = GET_BLKOFF_FROM_SEG0(sbi, blk);
- size = min((unsigned long)(end - blk), max_blocks);
+ if (end < START_BLOCK(sbi, segno + 1))
+ size = GET_BLKOFF_FROM_SEG0(sbi, end);
+ else
+ size = max_blocks;
map = (unsigned long *)(sentry->cur_valid_map);
offset = __find_rev_next_bit(map, size, offset);
f2fs_bug_on(sbi, offset != size);
- blk += size;
+ blk = START_BLOCK(sbi, segno + 1);
}
#endif
}