The patch titled Subject: kmod: convert two call sites to call_usermodehelper_fns() has been added to the -mm tree. Its filename is kmod-convert-two-call-sites-to-call_usermodehelper_fns.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Boaz Harrosh <bharrosh@xxxxxxxxxxx> Subject: kmod: convert two call sites to call_usermodehelper_fns() Both kernel/sys.c && security/keys/request_key.c where inlining the exact same code as call_usermodehelper_fns(); So simply convert these sites to directly use call_usermodehelper_fns(). Signed-off-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/sys.c | 19 ++++++++----------- security/keys/request_key.c | 13 +++---------- 2 files changed, 11 insertions(+), 21 deletions(-) diff -puN kernel/sys.c~kmod-convert-two-call-sites-to-call_usermodehelper_fns kernel/sys.c --- a/kernel/sys.c~kmod-convert-two-call-sites-to-call_usermodehelper_fns +++ a/kernel/sys.c @@ -2022,7 +2022,6 @@ int orderly_poweroff(bool force) NULL }; int ret = -ENOMEM; - struct subprocess_info *info; if (argv == NULL) { printk(KERN_WARNING "%s failed to allocate memory for \"%s\"\n", @@ -2030,18 +2029,16 @@ int orderly_poweroff(bool force) goto out; } - info = call_usermodehelper_setup(argv[0], argv, envp, GFP_ATOMIC); - if (info == NULL) { - argv_free(argv); - goto out; - } + ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_NO_WAIT, + NULL, argv_cleanup, NULL); +out: + if (likely(!ret)) + return 0; - call_usermodehelper_setfns(info, NULL, argv_cleanup, NULL); - - ret = call_usermodehelper_exec(info, UMH_NO_WAIT); + if (ret == -ENOMEM) + argv_free(argv); - out: - if (ret && force) { + if (force) { printk(KERN_WARNING "Failed to start orderly shutdown: " "forcing the issue\n"); diff -puN security/keys/request_key.c~kmod-convert-two-call-sites-to-call_usermodehelper_fns security/keys/request_key.c --- a/security/keys/request_key.c~kmod-convert-two-call-sites-to-call_usermodehelper_fns +++ a/security/keys/request_key.c @@ -93,16 +93,9 @@ static void umh_keys_cleanup(struct subp static int call_usermodehelper_keys(char *path, char **argv, char **envp, struct key *session_keyring, int wait) { - gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; - struct subprocess_info *info = - call_usermodehelper_setup(path, argv, envp, gfp_mask); - - if (!info) - return -ENOMEM; - - call_usermodehelper_setfns(info, umh_keys_init, umh_keys_cleanup, - key_get(session_keyring)); - return call_usermodehelper_exec(info, wait); + return call_usermodehelper_fns(path, argv, envp, wait, + umh_keys_init, umh_keys_cleanup, + key_get(session_keyring)); } /* _ Subject: Subject: kmod: convert two call sites to call_usermodehelper_fns() Patches currently in -mm which might be from bharrosh@xxxxxxxxxxx are origin.patch linux-next.patch kmod-unexport-call_usermodehelper_freeinfo.patch kmod-convert-two-call-sites-to-call_usermodehelper_fns.patch kmod-move-call_usermodehelper_fns-to-c-file-and-unexport-all-its-helpers.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html