]> git.hungrycats.org Git - linux/commitdiff
[PATCH] jffs2: Don't jump between contexts
authorAndrew Morton <akpm@osdl.org>
Tue, 24 Feb 2004 12:04:26 +0000 (04:04 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 24 Feb 2004 12:04:26 +0000 (04:04 -0800)
From: David Woodhouse <dwmw2@infradead.org>

Don't jump between contexts.

(don't write comprehensible changelogs, either).

fs/jffs2/background.c

index ebef6567753c8ec149c30785e248d1dc9dbb53a7..6412a0a9e8e544896a5349dbcda2552c757687bf 100644 (file)
@@ -124,11 +124,7 @@ static int jffs2_garbage_collect_thread(void *_c)
 
                        case SIGKILL:
                                D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGKILL received.\n"));
-                       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);
+                               goto die;
 
                        case SIGHUP:
                                D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread(): SIGHUP received.\n"));
@@ -146,6 +142,11 @@ static int jffs2_garbage_collect_thread(void *_c)
                        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)