aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2011-01-06 18:42:23 +0000
committerJohn Rigby <john.rigby@linaro.org>2011-10-17 02:34:08 -0600
commitdf0da0dbd97a14238bd9c168a2b8e1ed427d7e70 (patch)
tree0c4b4291392248505daf3bc247e1240269feb8d2
parent3d31087c272b55d005316410adde71be3231e622 (diff)
UBUNTU: SAUCE: ensure root is ready before running usermodehelpers in it
Signed-off-by: Andy Whitcroft <apw@canonical.com>
-rw-r--r--include/linux/init.h2
-rw-r--r--include/linux/kmod.h4
-rw-r--r--init/initramfs.c6
-rw-r--r--init/main.c2
4 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index 47235b8436f..1d34396d4be 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -223,8 +223,6 @@ extern int initcall_debug;
static initcall_t __initcall_##fn \
__used __section(.security_initcall.init) = fn
-extern struct list_head populate_rootfs_domain;
-
struct obs_kernel_param {
const char *str;
int (*setup_func)(char *);
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 0da38cf7db7..8a02da82aa9 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -84,6 +84,8 @@ int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
to call call_usermodehelper_exec */
void call_usermodehelper_freeinfo(struct subprocess_info *info);
+extern void populate_rootfs_wait(void);
+
static inline int
call_usermodehelper_fns(char *path, char **argv, char **envp,
enum umh_wait wait,
@@ -93,6 +95,8 @@ call_usermodehelper_fns(char *path, char **argv, char **envp,
struct subprocess_info *info;
gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;
+ populate_rootfs_wait();
+
info = call_usermodehelper_setup(path, argv, envp, gfp_mask);
if (info == NULL)
diff --git a/init/initramfs.c b/init/initramfs.c
index 1ecfa056c48..51192a48d09 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -572,6 +572,12 @@ static void __init clean_rootfs(void)
LIST_HEAD(populate_rootfs_domain);
+void populate_rootfs_wait(void)
+{
+ async_synchronize_full_domain(&populate_rootfs_domain);
+}
+EXPORT_SYMBOL(populate_rootfs_wait);
+
static void __init async_populate_rootfs(void)
{
char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
diff --git a/init/main.c b/init/main.c
index 5d96791e281..1bc53d75b0b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -833,7 +833,7 @@ static int __init kernel_init(void * unused)
* We need to ensure that the filesystem is ready by this point, wait for
* async_populate_rootfs to complete.
*/
- async_synchronize_full_domain(&populate_rootfs_domain);
+ populate_rootfs_wait();
/*
* check if there is an early userspace init. If yes, let it do all