summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-08-07 23:12:46 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-08-15 10:40:14 -0700
commitb8c502b81e3f899c6488967dec61eed0f5907db3 (patch)
treeec5f157c9804945eb46dc13b2fc3ab58d9e03bc6 /fs/f2fs/gc.c
parent9a20d391cd099d547c0f17626bf6f13e06da519a (diff)
downloadlinux-b8c502b81e3f899c6488967dec61eed0f5907db3.tar.bz2
f2fs: fix potential overflow when adjusting GC cycle
While comparing signed and unsigned variables, compiler will converts the signed value to unsigned one, due to this reason, {in,de}crease_sleep_time may return overflowed result. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 8da7c14a9d29..e60480f71bb5 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -28,7 +28,7 @@ static int gc_thread_func(void *data)
struct f2fs_sb_info *sbi = data;
struct f2fs_gc_kthread *gc_th = sbi->gc_thread;
wait_queue_head_t *wq = &sbi->gc_thread->gc_wait_queue_head;
- long wait_ms;
+ unsigned int wait_ms;
wait_ms = gc_th->min_sleep_time;