2.5.19 daemonize calls reparent_init for you
Subsystems (10)
PATCH 1/1 2.5.19 daemonize calls reparent_init for you
daemonize() should call reparent_to_init: a classic mistake (I made it recently).
Future potential cleanups:
daemonize() should take mask of signals to allow kernel_thread() should take a name to copy into ->comm.
Rusty.
kernel/exit.c +2 -0
@@ -227,6 +227,8 @@exit_files (current); current->files = init_task.files;atomic_inc (¤t->files->count); + +reparent_to_init (); }/*
drivers/hotplug/ibmphp_hpc.c +0 -1
@@ -1029,7 +1029,6 @@debug ("%s - Entry\n" , __FUNCTION__);lock_kernel ();daemonize (); -reparent_to_init ();// New name strcpy (current->comm,"hpc_poll" );
drivers/mtd/devices/blkmtd.c +0 -1
@@ -305,7 +305,6 @@DEBUG (1 ,"blkmtd: writetask: starting (pid = %d)\n" , tsk->pid);daemonize ();strcpy (tsk->comm,"blkmtdd" ); - tsk->tty =NULL ;spin_lock_irq (&tsk->sigmask_lock);sigfillset (&tsk->blocked);recalc_sigpending ();
drivers/net/8139too.c +1 -2
@@ -1556,8 +1556,7 @@struct rtl8139_private *tp = dev->priv;unsigned long timeout; -daemonize (); -reparent_to_init (); +daemonize ();spin_lock_irq (¤t->sigmask_lock);sigemptyset (¤t->blocked);recalc_sigpending ();
drivers/pnp/pnpbios_core.c +0 -1
@@ -610,7 +610,6 @@static struct pnp_docking_station_info now;int docked =-1 , d =0 ;daemonize (); -reparent_to_init ();strcpy (current->comm,"kpnpbiosd" );while (!unloading && !signal_pending (current)) {
drivers/usb/storage/usb.c +0 -1
@@ -317,7 +317,6 @@* so get rid of all our resources.. */ daemonize (); -reparent_to_init ();/* avoid getting signals */ spin_lock_irq (¤t->sigmask_lock);
fs/jffs2/background.c +0 -1
@@ -100,7 +100,6 @@struct jffs2_sb_info *c = _c;daemonize (); - current->tty =NULL ; c->gc_task = current;up (&c->gc_thread_start);
fs/jfs/jfs_logmgr.c +0 -1
@@ -2148,7 +2148,6 @@lock_kernel ();daemonize (); - current->tty =NULL ;strcpy (current->comm,"jfsIO" );unlock_kernel ();
fs/jfs/jfs_txnmgr.c +0 -2
@@ -2771,7 +2771,6 @@lock_kernel ();daemonize (); - current->tty =NULL ;strcpy (current->comm,"jfsCommit" );unlock_kernel ();
@@ -2895,7 +2894,6 @@lock_kernel ();daemonize (); - current->tty =NULL ;strcpy (current->comm,"jfsSync" );unlock_kernel ();
fs/lockd/clntlock.c +0 -1
@@ -202,7 +202,6 @@struct inode *inode;daemonize (); -reparent_to_init ();snprintf (current->comm,sizeof (current->comm),"%s-reclaim" , host->h_name);
fs/lockd/svc.c +0 -1
@@ -98,7 +98,6 @@up (&lockd_start);daemonize (); -reparent_to_init ();sprintf (current->comm,"lockd" );/* Process request with signals blocked. */
mm/pdflush.c +0 -1
@@ -82,7 +82,6 @@static int __pdflush (struct pdflush_work *my_work) {daemonize (); -reparent_to_init ();strcpy (current->comm,"pdflush" );/* interruptible sleep, so block all signals */
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Quoted 6 lines · Rusty Russell
daemonize()should callreparent_to_init: a classic mistake (I made it recently).Future potential cleanups:
daemonize() should take mask of signals to allow kernel_thread() should take a name to copy into ->comm.
Why no generating kernel threads by basically cloning "init"?
This is what we do anyway (creating a clone of init with special properties) but by cloning the current process and adjusting everything needed later to make it appear of a mixture of init clone and idle process clone.
Comments?
Regards
Ingo Oeser
Signature · 1 line
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth