diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-06-28 14:49:36 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-06-28 14:49:36 -0400 |
commit | e716dd3644c2a79d6ffa4359bac06f57479dcb34 (patch) | |
tree | a678acd5fc667e5b55adb7294fd5c6097aedc634 /fs/jffs2 | |
parent | 66bfaeaa90432a585d7e9e70605ee4df3ede9890 (diff) |
[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: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/background.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index 0c82dfcfd246..39bd6c7a9b62 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c | |||
@@ -83,7 +83,7 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
83 | 83 | ||
84 | for (;;) { | 84 | for (;;) { |
85 | allow_signal(SIGHUP); | 85 | allow_signal(SIGHUP); |
86 | 86 | again: | |
87 | if (!jffs2_thread_should_wake(c)) { | 87 | if (!jffs2_thread_should_wake(c)) { |
88 | set_current_state (TASK_INTERRUPTIBLE); | 88 | set_current_state (TASK_INTERRUPTIBLE); |
89 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n")); | 89 | D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n")); |
@@ -94,9 +94,6 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
94 | schedule(); | 94 | schedule(); |
95 | } | 95 | } |
96 | 96 | ||
97 | if (try_to_freeze()) | ||
98 | continue; | ||
99 | |||
100 | /* This thread is purely an optimisation. But if it runs when | 97 | /* This thread is purely an optimisation. But if it runs when |
101 | other things could be running, it actually makes things a | 98 | other things could be running, it actually makes things a |
102 | lot worse. Use yield() and put it at the back of the runqueue | 99 | lot worse. Use yield() and put it at the back of the runqueue |
@@ -111,6 +108,9 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
111 | siginfo_t info; | 108 | siginfo_t info; |
112 | unsigned long signr; | 109 | unsigned long signr; |
113 | 110 | ||
111 | if (try_to_freeze()) | ||
112 | goto again; | ||
113 | |||
114 | signr = dequeue_signal_lock(current, ¤t->blocked, &info); | 114 | signr = dequeue_signal_lock(current, ¤t->blocked, &info); |
115 | 115 | ||
116 | switch(signr) { | 116 | switch(signr) { |