summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorYunlong Song <yunlong.song@huawei.com>2017-08-04 17:07:15 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-08-15 10:40:10 -0700
commit008396e1b026b3873091b555b808155da7d9d18f (patch)
tree5ac002d856af919e83c9d2b0d0e46b54208bf002 /fs/f2fs
parentb0af6d491a6b5f5622fa91ac75f34f3640f862c4 (diff)
downloadlinux-rpi-008396e1b026b3873091b555b808155da7d9d18f.tar.gz
linux-rpi-008396e1b026b3873091b555b808155da7d9d18f.tar.bz2
linux-rpi-008396e1b026b3873091b555b808155da7d9d18f.zip
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/f2fs')
-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 c6e4a1174f8a..95267630c8c4 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -787,11 +787,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
}