Skip to content

Commit

Permalink
[JFFS2] Fix suspend failure with JFFS2 GC thread.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Woodhouse committed Aug 2, 2007
1 parent 71c2339 commit 7b68770
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/jffs2/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int jffs2_garbage_collect_thread(void *_c)
set_freezable();
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"));
Expand All @@ -95,9 +95,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
Expand All @@ -112,6 +109,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, &current->blocked, &info);

switch(signr) {
Expand Down

0 comments on commit 7b68770

Please sign in to comment.