Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 907ea42a authored by Yunlong Song's avatar Yunlong Song Committed by Sahitya Tummala
Browse files

f2fs: fix the size value in __check_sit_bitmap



commit 008396e1b026b3873091b555b808155da7d9d18f upstream.

The current size value is not correct and will miss bitmap check.

Signed-off-by: default avatarYunlong Song <yunlong.song@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Git-commit: 2f9f8a0b
Git-repo: https://android.googlesource.com/kernel/common.git


Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 7e74f8b2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -868,11 +868,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
}