Commit 0bf8f70a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] jffs2: Don't jump between contexts

From: David Woodhouse <dwmw2@infradead.org>

Don't jump between contexts.

(don't write comprehensible changelogs, either).
parent dc6a30eb
...@@ -124,11 +124,7 @@ static int jffs2_garbage_collect_thread(void *_c) ...@@ -124,11 +124,7 @@ static int jffs2_garbage_collect_thread(void *_c)
case SIGKILL: case SIGKILL:
D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGKILL received.\n")); D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGKILL received.\n"));
die: goto die;
spin_lock(&c->erase_completion_lock);
c->gc_task = NULL;
spin_unlock(&c->erase_completion_lock);
complete_and_exit(&c->gc_thread_exit, 0);
case SIGHUP: case SIGHUP:
D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGHUP received.\n")); D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGHUP received.\n"));
...@@ -146,6 +142,11 @@ static int jffs2_garbage_collect_thread(void *_c) ...@@ -146,6 +142,11 @@ static int jffs2_garbage_collect_thread(void *_c)
goto die; goto die;
} }
} }
die:
spin_lock(&c->erase_completion_lock);
c->gc_task = NULL;
spin_unlock(&c->erase_completion_lock);
complete_and_exit(&c->gc_thread_exit, 0);
} }
static int thread_should_wake(struct jffs2_sb_info *c) static int thread_should_wake(struct jffs2_sb_info *c)
......
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