3.16.49-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Jaegeuk Kim <jaeg...@kernel.org>

commit 1d7be2708277edfef95171d52fb65ee26eaa076b upstream.

This allows to freeze gc and discard threads.

Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org>
[bwh: Backported to 3.16: drop changes to discard thread]
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
---
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -35,13 +35,14 @@ static int gc_thread_func(void *data)
 
        wait_ms = gc_th->min_sleep_time;
 
+       set_freezable();
        do {
+               wait_event_interruptible_timeout(*wq,
+                               kthread_should_stop() || freezing(current),
+                               msecs_to_jiffies(wait_ms));
+
                if (try_to_freeze())
                        continue;
-               else
-                       wait_event_interruptible_timeout(*wq,
-                                               kthread_should_stop(),
-                                               msecs_to_jiffies(wait_ms));
                if (kthread_should_stop())
                        break;
 

Reply via email to