Skip to content

Commit

Permalink
f2fs: potential shift wrapping buf in f2fs_trim_fs()
Browse files Browse the repository at this point in the history
My static checker complains that segment is a u64 but only the lower 31
bits can be used before we hit a shift wrapping bug.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Dan Carpenter authored and Jaegeuk Kim committed Sep 30, 2014
1 parent 44c1615 commit 8a21984
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/f2fs/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#define TOTAL_BLKS(sbi) (TOTAL_SEGS(sbi) << sbi->log_blocks_per_seg)

#define MAX_BLKADDR(sbi) (SEG0_BLKADDR(sbi) + TOTAL_BLKS(sbi))
#define SEGMENT_SIZE(sbi) (1 << (sbi->log_blocksize + \
#define SEGMENT_SIZE(sbi) (1ULL << (sbi->log_blocksize + \
sbi->log_blocks_per_seg))

#define START_BLOCK(sbi, segno) (SEG0_BLKADDR(sbi) + \
Expand Down

0 comments on commit 8a21984

Please sign in to comment.