Commit 7b687707 authored by David Woodhouse's avatar David Woodhouse

[JFFS2] Fix suspend failure with JFFS2 GC thread.

The try_to_freeze() call was in the wrong place; we need it in the
signal-pending loop now that a pending freeze also makes
signal_pending() return true.
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 71c23397
...@@ -84,7 +84,7 @@ static int jffs2_garbage_collect_thread(void *_c) ...@@ -84,7 +84,7 @@ static int jffs2_garbage_collect_thread(void *_c)
set_freezable(); set_freezable();
for (;;) { for (;;) {
allow_signal(SIGHUP); allow_signal(SIGHUP);
again:
if (!jffs2_thread_should_wake(c)) { if (!jffs2_thread_should_wake(c)) {
set_current_state (TASK_INTERRUPTIBLE); set_current_state (TASK_INTERRUPTIBLE);
D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n")); D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n"));
...@@ -95,9 +95,6 @@ static int jffs2_garbage_collect_thread(void *_c) ...@@ -95,9 +95,6 @@ static int jffs2_garbage_collect_thread(void *_c)
schedule(); schedule();
} }
if (try_to_freeze())
continue;
/* This thread is purely an optimisation. But if it runs when /* This thread is purely an optimisation. But if it runs when
other things could be running, it actually makes things a other things could be running, it actually makes things a
lot worse. Use yield() and put it at the back of the runqueue lot worse. Use yield() and put it at the back of the runqueue
...@@ -112,6 +109,9 @@ static int jffs2_garbage_collect_thread(void *_c) ...@@ -112,6 +109,9 @@ static int jffs2_garbage_collect_thread(void *_c)
siginfo_t info; siginfo_t info;
unsigned long signr; unsigned long signr;
if (try_to_freeze())
goto again;
signr = dequeue_signal_lock(current, &current->blocked, &info); signr = dequeue_signal_lock(current, &current->blocked, &info);
switch(signr) { switch(signr) {
......
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