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

Commit 8a21984d authored by Dan Carpenter's avatar Dan Carpenter Committed by Jaegeuk Kim
Browse files

f2fs: potential shift wrapping buf in f2fs_trim_fs()



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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 44c16156
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) +			\