From: Jaegeuk Kim Date: Fri, 8 May 2015 23:37:28 +0000 (-0700) Subject: f2fs: avoid value overflow in showing current status X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3589a9190b927f68339f6c4779196360dd453a70;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git f2fs: avoid value overflow in showing current status This patch fixes overflow when do cat /sys/kernel/debug/f2fs/status. If a section is relatively large, dist value can be overflowed. Reported-by: Yossi Goldfill Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index f50acbc50998..efbc83f07305 100644 --- a/fs/f2fs/debug.c +++ b/fs/f2fs/debug.c @@ -94,7 +94,8 @@ static void update_general_status(struct f2fs_sb_info *sbi) static void update_sit_info(struct f2fs_sb_info *sbi) { struct f2fs_stat_info *si = F2FS_STAT(sbi); - unsigned int blks_per_sec, hblks_per_sec, total_vblocks, bimodal, dist; + unsigned long long blks_per_sec, hblks_per_sec, total_vblocks; + unsigned long long bimodal, dist; unsigned int segno, vblocks; int ndirty = 0;