summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-05-08 23:37:28 (GMT)
committerJaegeuk Kim <jaegeuk@kernel.org>2015-05-28 22:41:44 (GMT)
commit3589a9190b927f68339f6c4779196360dd453a70 (patch)
tree917fc397a4dd0c8e2ba27e6e31ec97675df938f0 /fs/f2fs
parent75cd4e098d178433436abce08146a21647bb4585 (diff)
downloadlinux-3589a9190b927f68339f6c4779196360dd453a70.tar.xz
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 <ygoldfill@radianmemory.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index f50acbc..efbc83f 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;