All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH 4/4] UML - kernel_thread shouldn't panic
@ 2007-04-02 16:50 ` Jeff Dike
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Dike @ 2007-04-02 16:50 UTC (permalink / raw)
  To: Andrew Morton, devzero; +Cc: LKML, uml-devel

kernel_thread should just return an error value on do_fork failure, not panic.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
--
 arch/um/kernel/process.c |    2 --
 1 file changed, 2 deletions(-)

Index: linux-2.6.21-mm/arch/um/kernel/process.c
===================================================================
--- linux-2.6.21-mm.orig/arch/um/kernel/process.c	2007-04-02 11:51:43.000000000 -0400
+++ linux-2.6.21-mm/arch/um/kernel/process.c	2007-04-02 12:01:00.000000000 -0400
@@ -97,8 +97,6 @@ int kernel_thread(int (*fn)(void *), voi
 	current->thread.request.u.thread.arg = arg;
 	pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0,
 		      &current->thread.regs, 0, NULL, NULL);
-	if(pid < 0)
-		panic("do_fork failed in kernel_thread, errno = %d", pid);
 	return pid;
 }
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 4/4] UML - kernel_thread shouldn't panic
@ 2007-04-02 16:50 ` Jeff Dike
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Dike @ 2007-04-02 16:50 UTC (permalink / raw)
  To: Andrew Morton, devzero; +Cc: LKML, uml-devel

kernel_thread should just return an error value on do_fork failure, not panic.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
--
 arch/um/kernel/process.c |    2 --
 1 file changed, 2 deletions(-)

Index: linux-2.6.21-mm/arch/um/kernel/process.c
===================================================================
--- linux-2.6.21-mm.orig/arch/um/kernel/process.c	2007-04-02 11:51:43.000000000 -0400
+++ linux-2.6.21-mm/arch/um/kernel/process.c	2007-04-02 12:01:00.000000000 -0400
@@ -97,8 +97,6 @@ int kernel_thread(int (*fn)(void *), voi
 	current->thread.request.u.thread.arg = arg;
 	pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0,
 		      &current->thread.regs, 0, NULL, NULL);
-	if(pid < 0)
-		panic("do_fork failed in kernel_thread, errno = %d", pid);
 	return pid;
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] [PATCH 4/4] UML - kernel_thread shouldn't panic
  2007-04-02 16:50 ` Jeff Dike
@ 2007-04-02 20:21   ` roland
  -1 siblings, 0 replies; 4+ messages in thread
From: roland @ 2007-04-02 20:21 UTC (permalink / raw)
  To: Jeff Dike, Andrew Morton; +Cc: LKML, uml-devel

i´d like to acknowledge that this fixes the problem i had when creating 
loop-devices inside uml.

instead of crashing the whole uml, losetup now tells:

ioctl: LOOP_SET_FD: Resource temporarily unavailable

and dmesg:

Apr  2 20:17:53 localhost udevd[641]: udev_event_run: fork of child failed: 
Resource temporarily unavailable
Apr  2 20:17:54 localhost last message repeated 4 times
Apr  2 20:17:54 localhost udevd-event[3014]: run_program: fork of 
'/lib/udev/udev_run_hotplugd' failed:Resource temporarily unavailable
Apr  2 20:17:54 localhost udevd-event[3014]: run_program: fork of 
'/lib/udev/udev_run_devd' failed: Resource temporarily unavailable
Apr  2 20:17:54 localhost udevd-event[3014]: run_program: fork of 
'/sbin/pam_console_apply' failed: Resource temporarily unavailable
Apr  2 20:17:54 localhost udevd[641]: udev_event_run: fork of child failed: 
Resource temporarily unavailable

so, this should be right behaviour now when running out of memory.

regards
roland

----- Original Message ----- 
From: "Jeff Dike" <jdike@addtoit.com>
To: "Andrew Morton" <akpm@osdl.org>; <devzero@web.de>
Cc: "LKML" <linux-kernel@vger.kernel.org>; "uml-devel" 
<user-mode-linux-devel@lists.sourceforge.net>
Sent: Monday, April 02, 2007 6:50 PM
Subject: [PATCH 4/4] UML - kernel_thread shouldn't panic


> kernel_thread should just return an error value on do_fork failure, not 
> panic.
>
> Signed-off-by: Jeff Dike <jdike@linux.intel.com>
> --
> arch/um/kernel/process.c |    2 --
> 1 file changed, 2 deletions(-)
>
> Index: linux-2.6.21-mm/arch/um/kernel/process.c
> ===================================================================
> --- linux-2.6.21-mm.orig/arch/um/kernel/process.c 2007-04-02 
> 11:51:43.000000000 -0400
> +++ linux-2.6.21-mm/arch/um/kernel/process.c 2007-04-02 
> 12:01:00.000000000 -0400
> @@ -97,8 +97,6 @@ int kernel_thread(int (*fn)(void *), voi
>  current->thread.request.u.thread.arg = arg;
>  pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0,
>        &current->thread.regs, 0, NULL, NULL);
> - if(pid < 0)
> - panic("do_fork failed in kernel_thread, errno = %d", pid);
>  return pid;
> }
> 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4/4] UML - kernel_thread shouldn't panic
@ 2007-04-02 20:21   ` roland
  0 siblings, 0 replies; 4+ messages in thread
From: roland @ 2007-04-02 20:21 UTC (permalink / raw)
  To: Jeff Dike, Andrew Morton; +Cc: LKML, uml-devel

i´d like to acknowledge that this fixes the problem i had when creating 
loop-devices inside uml.

instead of crashing the whole uml, losetup now tells:

ioctl: LOOP_SET_FD: Resource temporarily unavailable

and dmesg:

Apr  2 20:17:53 localhost udevd[641]: udev_event_run: fork of child failed: 
Resource temporarily unavailable
Apr  2 20:17:54 localhost last message repeated 4 times
Apr  2 20:17:54 localhost udevd-event[3014]: run_program: fork of 
'/lib/udev/udev_run_hotplugd' failed:Resource temporarily unavailable
Apr  2 20:17:54 localhost udevd-event[3014]: run_program: fork of 
'/lib/udev/udev_run_devd' failed: Resource temporarily unavailable
Apr  2 20:17:54 localhost udevd-event[3014]: run_program: fork of 
'/sbin/pam_console_apply' failed: Resource temporarily unavailable
Apr  2 20:17:54 localhost udevd[641]: udev_event_run: fork of child failed: 
Resource temporarily unavailable

so, this should be right behaviour now when running out of memory.

regards
roland

----- Original Message ----- 
From: "Jeff Dike" <jdike@addtoit.com>
To: "Andrew Morton" <akpm@osdl.org>; <devzero@web.de>
Cc: "LKML" <linux-kernel@vger.kernel.org>; "uml-devel" 
<user-mode-linux-devel@lists.sourceforge.net>
Sent: Monday, April 02, 2007 6:50 PM
Subject: [PATCH 4/4] UML - kernel_thread shouldn't panic


> kernel_thread should just return an error value on do_fork failure, not 
> panic.
>
> Signed-off-by: Jeff Dike <jdike@linux.intel.com>
> --
> arch/um/kernel/process.c |    2 --
> 1 file changed, 2 deletions(-)
>
> Index: linux-2.6.21-mm/arch/um/kernel/process.c
> ===================================================================
> --- linux-2.6.21-mm.orig/arch/um/kernel/process.c 2007-04-02 
> 11:51:43.000000000 -0400
> +++ linux-2.6.21-mm/arch/um/kernel/process.c 2007-04-02 
> 12:01:00.000000000 -0400
> @@ -97,8 +97,6 @@ int kernel_thread(int (*fn)(void *), voi
>  current->thread.request.u.thread.arg = arg;
>  pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0,
>        &current->thread.regs, 0, NULL, NULL);
> - if(pid < 0)
> - panic("do_fork failed in kernel_thread, errno = %d", pid);
>  return pid;
> }
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-04-02 20:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-02 16:50 [uml-devel] [PATCH 4/4] UML - kernel_thread shouldn't panic Jeff Dike
2007-04-02 16:50 ` Jeff Dike
2007-04-02 20:21 ` [uml-devel] " roland
2007-04-02 20:21   ` roland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.