From: Dan Carpenter Date: Thu, 25 Sep 2014 11:39:17 +0000 (+0300) Subject: f2fs: potential shift wrapping buf in f2fs_trim_fs() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8a21984d5d86540ba32b4b346d8fe6426018b7a7;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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: Dan Carpenter Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index a7e3e9112100..afb73627a8ec 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -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) + \