public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.5.19 daemonize calls reparent_init for you
Date: Thu, 30 May 2002 15:05:07 +1000	[thread overview]
Message-ID: <E17DI7X-00030e-00@wagner.rustcorp.com.au> (raw)

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.

diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/kernel/exit.c linux-2.5.19.11306.updated/kernel/exit.c
--- linux-2.5.19.11306/kernel/exit.c	Thu May 30 10:00:59 2002
+++ linux-2.5.19.11306.updated/kernel/exit.c	Thu May 30 14:57:33 2002
@@ -227,6 +227,8 @@
  	exit_files(current);
 	current->files = init_task.files;
 	atomic_inc(&current->files->count);
+
+	reparent_to_init();
 }
 
 /*
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/drivers/hotplug/ibmphp_hpc.c linux-2.5.19.11306.updated/drivers/hotplug/ibmphp_hpc.c
--- linux-2.5.19.11306/drivers/hotplug/ibmphp_hpc.c	Mon May 13 12:00:35 2002
+++ linux-2.5.19.11306.updated/drivers/hotplug/ibmphp_hpc.c	Thu May 30 14:57:32 2002
@@ -1029,7 +1029,6 @@
 	debug ("%s - Entry\n", __FUNCTION__);
 	lock_kernel ();
 	daemonize ();
-	reparent_to_init ();
 
 	//  New name
 	strcpy (current->comm, "hpc_poll");
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/drivers/mtd/devices/blkmtd.c linux-2.5.19.11306.updated/drivers/mtd/devices/blkmtd.c
--- linux-2.5.19.11306/drivers/mtd/devices/blkmtd.c	Mon May  6 11:11:54 2002
+++ linux-2.5.19.11306.updated/drivers/mtd/devices/blkmtd.c	Thu May 30 14:57:32 2002
@@ -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();
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/drivers/net/8139too.c linux-2.5.19.11306.updated/drivers/net/8139too.c
--- linux-2.5.19.11306/drivers/net/8139too.c	Sun May 19 12:07:30 2002
+++ linux-2.5.19.11306.updated/drivers/net/8139too.c	Thu May 30 14:57:32 2002
@@ -1556,8 +1556,7 @@
 	struct rtl8139_private *tp = dev->priv;
 	unsigned long timeout;
 
-	daemonize ();
-	reparent_to_init();
+	daemonize();
 	spin_lock_irq(&current->sigmask_lock);
 	sigemptyset(&current->blocked);
 	recalc_sigpending();
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/drivers/pnp/pnpbios_core.c linux-2.5.19.11306.updated/drivers/pnp/pnpbios_core.c
--- linux-2.5.19.11306/drivers/pnp/pnpbios_core.c	Sat May 25 14:34:46 2002
+++ linux-2.5.19.11306.updated/drivers/pnp/pnpbios_core.c	Thu May 30 14:57:32 2002
@@ -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))
 	{
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/drivers/usb/storage/usb.c linux-2.5.19.11306.updated/drivers/usb/storage/usb.c
--- linux-2.5.19.11306/drivers/usb/storage/usb.c	Thu May 30 10:00:55 2002
+++ linux-2.5.19.11306.updated/drivers/usb/storage/usb.c	Thu May 30 14:57:32 2002
@@ -317,7 +317,6 @@
 	 * so get rid of all our resources..
 	 */
 	daemonize();
-	reparent_to_init();
 
 	/* avoid getting signals */
 	spin_lock_irq(&current->sigmask_lock);
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/fs/jffs2/background.c linux-2.5.19.11306.updated/fs/jffs2/background.c
--- linux-2.5.19.11306/fs/jffs2/background.c	Thu Mar 21 14:14:51 2002
+++ linux-2.5.19.11306.updated/fs/jffs2/background.c	Thu May 30 14:57:32 2002
@@ -100,7 +100,6 @@
 	struct jffs2_sb_info *c = _c;
 
 	daemonize();
-	current->tty = NULL;
 	c->gc_task = current;
 	up(&c->gc_thread_start);
 
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/fs/jfs/jfs_logmgr.c linux-2.5.19.11306.updated/fs/jfs/jfs_logmgr.c
--- linux-2.5.19.11306/fs/jfs/jfs_logmgr.c	Sat May 25 14:34:51 2002
+++ linux-2.5.19.11306.updated/fs/jfs/jfs_logmgr.c	Thu May 30 14:57:32 2002
@@ -2148,7 +2148,6 @@
 	lock_kernel();
 
 	daemonize();
-	current->tty = NULL;
 	strcpy(current->comm, "jfsIO");
 
 	unlock_kernel();
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/fs/jfs/jfs_txnmgr.c linux-2.5.19.11306.updated/fs/jfs/jfs_txnmgr.c
--- linux-2.5.19.11306/fs/jfs/jfs_txnmgr.c	Tue May 21 16:33:35 2002
+++ linux-2.5.19.11306.updated/fs/jfs/jfs_txnmgr.c	Thu May 30 14:57:33 2002
@@ -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();
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/fs/lockd/clntlock.c linux-2.5.19.11306.updated/fs/lockd/clntlock.c
--- linux-2.5.19.11306/fs/lockd/clntlock.c	Wed Feb 20 17:56:39 2002
+++ linux-2.5.19.11306.updated/fs/lockd/clntlock.c	Thu May 30 14:57:33 2002
@@ -202,7 +202,6 @@
 	struct inode *inode;
 
 	daemonize();
-	reparent_to_init();
 	snprintf(current->comm, sizeof(current->comm),
 		 "%s-reclaim",
 		 host->h_name);
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/fs/lockd/svc.c linux-2.5.19.11306.updated/fs/lockd/svc.c
--- linux-2.5.19.11306/fs/lockd/svc.c	Mon Apr 15 11:47:40 2002
+++ linux-2.5.19.11306.updated/fs/lockd/svc.c	Thu May 30 14:57:33 2002
@@ -98,7 +98,6 @@
 	up(&lockd_start);
 
 	daemonize();
-	reparent_to_init();
 	sprintf(current->comm, "lockd");
 
 	/* Process request with signals blocked.  */
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.19.11306/mm/pdflush.c linux-2.5.19.11306.updated/mm/pdflush.c
--- linux-2.5.19.11306/mm/pdflush.c	Thu May 30 10:00:59 2002
+++ linux-2.5.19.11306.updated/mm/pdflush.c	Thu May 30 14:57:33 2002
@@ -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.

             reply	other threads:[~2002-05-30  5:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-30  5:05 Rusty Russell [this message]
2002-05-30 10:05 ` [PATCH] 2.5.19 daemonize calls reparent_init for you Ingo Oeser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E17DI7X-00030e-00@wagner.rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox