[PATCH] 2.2 keventd fix

From: Andreas Bombe (bombe@informatik.tu-muenchen.de)
Date: Mon Nov 19 2001 - 19:16:29 EST


In the 2.2 version of keventd flush_scheduled_tasks() always oopses. It
adds a tq_struct with NULL routine to kick keventd to life which is
skipped by 2.4 run_task_queue() but the 2.2 one tries to execute it.

The following patch fixes that, I also added some spin locking from the
2.4 version which seems to be added after the backport. (patch against
2.2.20)

--- linux-2.2.orig/kernel/context.c Sun May 27 03:21:32 2001
+++ linux-2.2/kernel/context.c Mon Nov 19 04:04:37 2001
@@ -101,8 +101,10 @@
                 if (signal_pending(curtask)) {
                         while (waitpid(-1, (unsigned int *)0, __WALL|WNOHANG) > 0)
                                 ;
+ spin_lock_irq(&curtask->sigmask_lock);
                         flush_signals(curtask);
                         recalc_sigpending(curtask);
+ spin_unlock_irq(&curtask->sigmask_lock);
                 }
         }
 }
@@ -119,7 +121,8 @@
  * The caller should hold no spinlocks and should hold no semaphores which could
  * cause the scheduled tasks to block.
  */
-static struct tq_struct dummy_task;
+static void dummy_routine(void *whatever) {}
+static struct tq_struct dummy_task = { routine: dummy_routine };
 
 void flush_scheduled_tasks(void)
 {

-- 
Andreas Bombe <bombe@informatik.tu-muenchen.de>    DSA key 0x04880A44
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:22 EST