[JFFS2] Fix suspend failure with JFFS2 GC thread.
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Jun 28 14:59:01 EDT 2007
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e716dd3644c2a79d6ffa4359bac06f57479dcb34
Commit: e716dd3644c2a79d6ffa4359bac06f57479dcb34
Parent: 66bfaeaa90432a585d7e9e70605ee4df3ede9890
Author: David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Thu Jun 28 19:49:36 2007 +0100
Committer: David Woodhouse <dwmw2 at infradead.org>
CommitDate: Thu Jun 28 19:49:36 2007 +0100
[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 at infradead.org>
---
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 0c82dfc..39bd6c7 100644
--- a/fs/jffs2/background.c
+++ b/fs/jffs2/background.c
@@ -83,7 +83,7 @@ static int jffs2_garbage_collect_thread(void *_c)
for (;;) {
allow_signal(SIGHUP);
-
+ again:
if (!jffs2_thread_should_wake(c)) {
set_current_state (TASK_INTERRUPTIBLE);
D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n"));
@@ -94,9 +94,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
@@ -111,6 +108,9 @@ static int jffs2_garbage_collect_thread(void *_c)
siginfo_t info;
unsigned long signr;
+ if (try_to_freeze())
+ goto again;
+
signr = dequeue_signal_lock(current, ¤t->blocked, &info);
switch(signr) {
More information about the linux-mtd-cvs
mailing list