[Drbd-dev] [PATCH 0/1] usermodehelper: use UMH_WAIT_PROC consistently
Oleg Nesterov
oleg at redhat.com
Wed Feb 8 15:03:33 CET 2012
On 02/08, Tetsuo Handa wrote:
>
> Oleg Nesterov wrote:
>
> > Subject: [PATCH 1/5] usermodehelper: kill umh_wait, renumber UMH_* constants
> >
> > No functional changes, preparation.
> >
> > umh_wait doesn't can't be used as a bitmask, and we do not want
> > to add another argument call_usermodehelper_* helpers.
> >
> > Kill this enum and redefine the UMH_* constants.
>
> There are several users that call call_usermodehelper() without using this
> enum. security/tomoyo/load_policy.c is one of such users
... and there are more.
Thanks a lot Tetsuo.
> and there will be some
> in out-of-tree code.
Well, they should be fixed imho.
> Since I think distro kernels want
> to backport this killable request_module() patchset, this patch should not
> change the constants in a way that makes impossible to detect kABI changes.
Good point, but I think the backporter should take care to not break
the KABI. I do not think we should defer the possible cleanups for
the sake of backporting.
It is possible to skip the first patch and add UMH_KILLABLE, just
call_usermodehelper_exec() needs the additional wait != UMH_NO_WAIT
check before testind/clearing UMH_KILLABLE. UMH_NO_WAIT | KILLABLE
is not possible.
> #define UMH_WAIT_EXEC 0 /* wait for the exec, but not the process */
> #define UMH_WAIT_PROC 1 /* wait for the process to complete */
> #define UMH_KILLABLE 2 /* wait for EXEC/PROC killable */
> #define UMH_NO_WAIT 4 /* don't wait at all */
>
> might be acceptable because we can remap -1 -> UMH_NO_WAIT on
> call_usermodehelper_exec() side.
Yes... but I think it is better to fix the users.
Perhaps we can do something like
#define UMH_NO_WAIT 0x8000
#define UMH_WAIT_EXEC 0x8001
#define UMH_WAIT_ 0x8002
and then call_usermodehelper_exec() does
/* catch the old buggy users */
BUG_ON(!(wait & 0x8000) || (wait < 0))
In any case. Whatever we do, I think we should fix the current ab-users.
Andrew, could you take this patch? Or should I split this trivial change
by file/maintainer?
Oleg.
More information about the drbd-dev
mailing list