Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

Oleg Nesterov
2013-02-25T18:09:35Z

On 02/25, Lucas De Marchi wrote:
>
> Yep. The current interface is confusing. I agree that a separate
> setup() + exec() would make more sense.

Great,

> > @@ -98,8 +98,14 @@ static int call_modprobe(char *module_na
> > 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);
> > + info = call_usermodehelper_setup(...); // better name, please...
> > + if (!info)
> > + goto free_modname;
> > +
> > + return call_usermodehelper_exec(info, wait);
>
> I'd say that in these cases the "call_" prefix has no meaning, and we
> could just use a "usermodehelper" as the namespace.

Oh, I agree with any naming.

So, I hope you will send v2. I'd suggest to split the fixes. 1/3
should create/export the new helpers, and 2-3 fix should call_modprobe()
and call_usermodehelper_keys(). But this is up to you, I won't insist.

Oleg.