[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130309202329.GC16399@redhat.com>
Date: Sat, 9 Mar 2013 21:23:29 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Lucas De Marchi <lucas.demarchi@...fusion.mobi>
Cc: lucas.de.marchi@...il.com, David Howells <dhowells@...hat.com>,
James Morris <james.l.morris@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/7] kmod: split call to call_usermodehelper_fns()
On 03/08, Lucas De Marchi wrote:
>
> Use call_usermodehelper_setup() + call_usermodehelper_exec() instead of
> calling call_usermodehelper_fns(). In case the latter returns -ENOMEM
> the cleanup function may had not been called - in this case we would
> not free argv and module_name.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@...fusion.mobi>
Thanks!
looks correct, but...
> @@ -98,8 +100,17 @@ static int call_modprobe(char *module_name, int wait)
> argv[3] = module_name; /* check free_modprobe_argv() */
> argv[4] = NULL;
>
> - return call_usermodehelper_fns(modprobe_path, argv, envp,
> - wait | UMH_KILLABLE, NULL, free_modprobe_argv, NULL);
> + gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;
Why? it is never called with UMH_NO_WAIT,
> + info = call_usermodehelper_setup(modprobe_path, argv, envp,
> + gfp_mask, NULL, free_modprobe_argv,
can't we simply use GFP_KERNEL?
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists