aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/jffs2/background.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c
index 5548749bacb6..65119d72cce0 100644
--- a/fs/jffs2/background.c
+++ b/fs/jffs2/background.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: background.c,v 1.52 2005/05/19 16:18:08 gleixner Exp $ 10 * $Id: background.c,v 1.54 2005/05/20 21:37:12 gleixner Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -56,13 +56,16 @@ int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c)
56 56
57void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) 57void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c)
58{ 58{
59 int wait = 0;
59 spin_lock(&c->erase_completion_lock); 60 spin_lock(&c->erase_completion_lock);
60 if (c->gc_task) { 61 if (c->gc_task) {
61 D1(printk(KERN_DEBUG "jffs2: Killing GC task %d\n", c->gc_task->pid)); 62 D1(printk(KERN_DEBUG "jffs2: Killing GC task %d\n", c->gc_task->pid));
62 send_sig(SIGKILL, c->gc_task, 1); 63 send_sig(SIGKILL, c->gc_task, 1);
64 wait = 1;
63 } 65 }
64 spin_unlock(&c->erase_completion_lock); 66 spin_unlock(&c->erase_completion_lock);
65 wait_for_completion(&c->gc_thread_exit); 67 if (wait)
68 wait_for_completion(&c->gc_thread_exit);
66} 69}
67 70
68static int jffs2_garbage_collect_thread(void *_c) 71static int jffs2_garbage_collect_thread(void *_c)