UBUNTU: SAUCE: ensure root is ready before running usermodehelpers in it
authorAndy Whitcroft <apw@canonical.com>
Thu, 6 Jan 2011 18:42:23 +0000 (18:42 +0000)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:13:36 +0000 (13:13 -0700)
Signed-off-by: Andy Whitcroft <apw@canonical.com>

include/linux/init.h
include/linux/kmod.h
init/initramfs.c
init/main.c

index 47235b8..1d34396 100644 (file)
@@ -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 *);
index b16f653..8ce70e7 100644 (file)
@@ -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);
 
+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)
index 1ecfa05..2d47aca 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/syscalls.h>
 #include <linux/utime.h>
 #include <linux/async.h>
+#include <linux/export.h>
 
 static __initdata char *message;
 static void __init error(char *x)
@@ -572,6 +573,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);
index fd34753..c98afa1 100644 (file)
@@ -848,7 +848,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