aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2013-04-30 18:28:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 20:04:06 -0400
commit907ed1328d2a748f3d6028503d3e04c74ea62730 (patch)
treee91582c2932917736319430f501ee5a9b9f4a0a7
parentfb96c475f6b27bd2c7f6fe0720e6972909a203ca (diff)
usermodehelper: split remaining calls to call_usermodehelper_fns()
These are the only users of call_usermodehelper_fns(). This function suffers from not being able to determine if the cleanup is called. Even if in this places the cleanup pointer is NULL, convert them to use the separate call_usermodehelper_setup() + call_usermodehelper_exec() functions so we can remove the _fns variant. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi> Cc: Oleg Nesterov <oleg@redhat.com> Cc: David Howells <dhowells@redhat.com> Cc: James Morris <james.l.morris@oracle.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Tejun Heo <tj@kernel.org> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/coredump.c12
-rw-r--r--init/do_mounts_initrd.c8
2 files changed, 15 insertions, 5 deletions
diff --git a/fs/coredump.c b/fs/coredump.c
index 7dfb3b062e24..d52f6bd5ad8e 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -525,6 +525,7 @@ void do_coredump(siginfo_t *siginfo)
525 if (ispipe) { 525 if (ispipe) {
526 int dump_count; 526 int dump_count;
527 char **helper_argv; 527 char **helper_argv;
528 struct subprocess_info *sub_info;
528 529
529 if (ispipe < 0) { 530 if (ispipe < 0) {
530 printk(KERN_WARNING "format_corename failed\n"); 531 printk(KERN_WARNING "format_corename failed\n");
@@ -571,9 +572,14 @@ void do_coredump(siginfo_t *siginfo)
571 goto fail_dropcount; 572 goto fail_dropcount;
572 } 573 }
573 574
574 retval = call_usermodehelper_fns(helper_argv[0], helper_argv, 575 retval = -ENOMEM;
575 NULL, UMH_WAIT_EXEC, umh_pipe_setup, 576 sub_info = call_usermodehelper_setup(helper_argv[0],
576 NULL, &cprm); 577 helper_argv, NULL, GFP_KERNEL,
578 umh_pipe_setup, NULL, &cprm);
579 if (sub_info)
580 retval = call_usermodehelper_exec(sub_info,
581 UMH_WAIT_EXEC);
582
577 argv_free(helper_argv); 583 argv_free(helper_argv);
578 if (retval) { 584 if (retval) {
579 printk(KERN_INFO "Core dump to %s pipe failed\n", 585 printk(KERN_INFO "Core dump to %s pipe failed\n",
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index a32ec1ce882b..3e0878e8a80d 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -50,6 +50,7 @@ static int init_linuxrc(struct subprocess_info *info, struct cred *new)
50 50
51static void __init handle_initrd(void) 51static void __init handle_initrd(void)
52{ 52{
53 struct subprocess_info *info;
53 static char *argv[] = { "linuxrc", NULL, }; 54 static char *argv[] = { "linuxrc", NULL, };
54 extern char *envp_init[]; 55 extern char *envp_init[];
55 int error; 56 int error;
@@ -70,8 +71,11 @@ static void __init handle_initrd(void)
70 */ 71 */
71 current->flags |= PF_FREEZER_SKIP; 72 current->flags |= PF_FREEZER_SKIP;
72 73
73 call_usermodehelper_fns("/linuxrc", argv, envp_init, UMH_WAIT_PROC, 74 info = call_usermodehelper_setup("/linuxrc", argv, envp_init,
74 init_linuxrc, NULL, NULL); 75 GFP_KERNEL, init_linuxrc, NULL, NULL);
76 if (!info)
77 return;
78 call_usermodehelper_exec(info, UMH_WAIT_PROC);
75 79
76 current->flags &= ~PF_FREEZER_SKIP; 80 current->flags &= ~PF_FREEZER_SKIP;
77 81