diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index 888f236..43a2fc8 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c @@ -96,9 +96,6 @@ static int jffs2_garbage_collect_thread(void *_c) schedule(); } - if (try_to_freeze()) - continue; - /* This thread is purely an optimisation. But if it runs when other things could be running, it actually makes things a lot worse. Use yield() and put it at the back of the runqueue @@ -113,6 +110,9 @@ static int jffs2_garbage_collect_thread(void *_c) siginfo_t info; unsigned long signr; + if (try_to_freeze()) + continue; + signr = dequeue_signal_lock(current, ¤t->blocked, &info); switch(signr) { @@ -137,7 +137,7 @@ static int jffs2_garbage_collect_thread(void *_c) disallow_signal(SIGHUP); D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): pass\n")); - if (jffs2_garbage_collect_pass(c) == -ENOSPC) { + if (jffs2_thread_should_wake(c) && jffs2_garbage_collect_pass(c) == -ENOSPC) { printk(KERN_NOTICE "No space for garbage collection. Aborting GC thread\n"); goto die; }