Re: [PATCH v2 1/2] modules: split part of complete_formation() into prepare_coming_module()

From: Petr Mladek
Date: Mon Mar 14 2016 - 11:13:02 EST


On Fri 2016-03-11 15:03:47, Jessica Yu wrote:
> Put all actions in complete_formation() that are performed after
> module->state is set to MODULE_STATE_COMING into a separate function
> prepare_coming_module(). This split prepares for the removal of the
> livepatch module notifiers in favor of hard-coding function calls to
> klp_module_{coming,going} in the module loader.
>
> The complete_formation -> prepare_coming_module split will also make error
> handling easier since we can jump to the appropriate error label to do any
> module GOING cleanup after all the COMING-actions have completed.
>
> Signed-off-by: Jessica Yu <jeyu@xxxxxxxxxx>
> Reviewed-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Acked-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
> ---
> kernel/module.c | 26 ++++++++++++++++++--------
> 1 file changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 87cfeb2..1981ae0 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -3312,6 +3312,14 @@ out_unlocked:
> return err;
> }
>
> +static int prepare_coming_module(struct module *mod)
> +{
> + ftrace_module_enable(mod);
> + blocking_notifier_call_chain(&module_notify_list,
> + MODULE_STATE_COMING, mod);
> + return 0;
> +}

Nit, just in case you send a new version. Please, move this below
complete_formation(). It is nice when the funtions are defined
in the same order as they are called :-)

It is a cosmetic change and it should not invalidate other acks.

In each case, the patch looks fine:

Reviewed-by: Petr Mladek <pmladek@xxxxxxx>

Best Regards,
Petr