All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reboot: disable usermodehelper to prevent fs access
@ 2011-05-05 11:32 Kay Sievers
  2011-05-05 20:27 ` Greg KH
  2011-05-05 21:24 ` Valdis.Kletnieks
  0 siblings, 2 replies; 7+ messages in thread
From: Kay Sievers @ 2011-05-05 11:32 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

From: Kay Sievers <kay.sievers@vrfy.org>
Subject: [PATCH] reboot: disable usermodehelper to prevent fs access

In case CONFIG_UEVENT_HELPER_PATH is not set to "", which it
should be on every system, the kernel forks processes during
shutdown, which try to access the rootfs, even when the
binary does not exist. It causes exceptions and long delays in
the disk driver, which gets read requests at the time it tries
to shut down the disk.

This patch disables all kernel-forked processes during reboot to
allow a clean poweroff.

Cc: Tejun Heo <htejun@gmail.com>
Tested-By: Anton Guda <atu@dmeti.dp.ua>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---
 sys.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sys.c b/kernel/sys.c
index af468ed..70c4c51 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -314,6 +314,7 @@ void kernel_restart_prepare(char *cmd)
 {
 	blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
 	system_state = SYSTEM_RESTART;
+	usermodehelper_disable();
 	device_shutdown();
 	sysdev_shutdown();
 	syscore_shutdown();
@@ -344,6 +345,7 @@ static void kernel_shutdown_prepare(enum system_states state)
 	blocking_notifier_call_chain(&reboot_notifier_list,
 		(state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
 	system_state = state;
+	usermodehelper_disable();
 	device_shutdown();
 }
 /**



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

end of thread, other threads:[~2011-05-06  1:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05 11:32 [PATCH] reboot: disable usermodehelper to prevent fs access Kay Sievers
2011-05-05 20:27 ` Greg KH
2011-05-06  1:15   ` Kay Sievers
2011-05-05 21:24 ` Valdis.Kletnieks
2011-05-05 21:34   ` Greg KH
2011-05-06  0:04     ` Valdis.Kletnieks
2011-05-06  1:07       ` Kay Sievers

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.