Commit 3589a919 authored by Jaegeuk Kim's avatar Jaegeuk Kim

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: default avatarYossi Goldfill <ygoldfill@radianmemory.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 75cd4e09
...@@ -94,7 +94,8 @@ static void update_general_status(struct f2fs_sb_info *sbi) ...@@ -94,7 +94,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
static void update_sit_info(struct f2fs_sb_info *sbi) static void update_sit_info(struct f2fs_sb_info *sbi)
{ {
struct f2fs_stat_info *si = F2FS_STAT(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; unsigned int segno, vblocks;
int ndirty = 0; int ndirty = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment