Skip to content

Commit 9feffe1

Browse files
Zhihao ChengJaegeuk Kim
authored andcommitted
f2fs: update_sit_entry: Make the judgment condition of f2fs_bug_on more intuitive
Current judgment condition of f2fs_bug_on in function update_sit_entry(): new_vblocks >> (sizeof(unsigned short) << 3) || new_vblocks > sbi->blocks_per_seg which equivalents to: new_vblocks < 0 || new_vblocks > sbi->blocks_per_seg The latter is more intuitive. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Reported-by: Jack Qiu <jack.qiu@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 58f7e00 commit 9feffe1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/f2fs/segment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)
21662166
new_vblocks = se->valid_blocks + del;
21672167
offset = GET_BLKOFF_FROM_SEG0(sbi, blkaddr);
21682168

2169-
f2fs_bug_on(sbi, (new_vblocks >> (sizeof(unsigned short) << 3) ||
2169+
f2fs_bug_on(sbi, (new_vblocks < 0 ||
21702170
(new_vblocks > sbi->blocks_per_seg)));
21712171

21722172
se->valid_blocks = new_vblocks;

0 commit comments

Comments
 (0)