linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Miroslav Benes <mbenes@suse.cz>, Jason Baron <jbaron@akamai.com>,
	Evgenii Shatokhin <eshatokhin@virtuozzo.com>,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] livepatch: Module coming and going callbacks can proceed all listed patches
Date: Mon, 21 Jan 2019 17:47:28 -0500	[thread overview]
Message-ID: <20190121224728.GC8766@redhat.com> (raw)
In-Reply-To: <20190116161720.796-4-pmladek@suse.com>

On Wed, Jan 16, 2019 at 05:17:19PM +0100, Petr Mladek wrote:
> Livepatches can not longer get enabled and disabled repeatedly.

nit: s/not longer/no longer/g

> The list klp_patches contains only enabled patches and eventually
> the patch in transition.
> 
> The module coming and going callbacks do not longer need to
> check for these state. They have to proceed all listed patches.

nit: suggestion to modify "proceed all" to "proceed with" or "execute
all".  Same suggestion for the subject line.  (I keep reading it as
"precede all" and I'm wondering if there is some kind of ordering
change.)
   
> 
> Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
> Signed-off-by: Petr Mladek <pmladek@suse.com>
> ---
>  kernel/livepatch/core.c | 26 ++++++--------------------
>  1 file changed, 6 insertions(+), 20 deletions(-)
> 
> diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
> index b716a6289204..684766d306ad 100644
> --- a/kernel/livepatch/core.c
> +++ b/kernel/livepatch/core.c
> @@ -1141,21 +1141,14 @@ static void klp_cleanup_module_patches_limited(struct module *mod,
>  			if (!klp_is_module(obj) || strcmp(obj->name, mod->name))
>  				continue;
>  
> -			/*
> -			 * Only unpatch the module if the patch is enabled or
> -			 * is in transition.
> -			 */
> -			if (patch->enabled || patch == klp_transition_patch) {
> -
> -				if (patch != klp_transition_patch)
> -					klp_pre_unpatch_callback(obj);
> +			if (patch != klp_transition_patch)
> +				klp_pre_unpatch_callback(obj);
>  
> -				pr_notice("reverting patch '%s' on unloading module '%s'\n",
> -					  patch->mod->name, obj->mod->name);
> -				klp_unpatch_object(obj);
> +			pr_notice("reverting patch '%s' on unloading module '%s'\n",
> +				  patch->mod->name, obj->mod->name);
> +			klp_unpatch_object(obj);
>  
> -				klp_post_unpatch_callback(obj);
> -			}
> +			klp_post_unpatch_callback(obj);
>  
>  			klp_free_object_loaded(obj);
>  			break;
> @@ -1194,13 +1187,6 @@ int klp_module_coming(struct module *mod)
>  				goto err;
>  			}
>  
> -			/*
> -			 * Only patch the module if the patch is enabled or is
> -			 * in transition.
> -			 */
> -			if (!patch->enabled && patch != klp_transition_patch)
> -				break;
> -
>  			pr_notice("applying patch '%s' to loading module '%s'\n",
>  				  patch->mod->name, obj->mod->name);
>  
> -- 
> 2.13.7
> 

Any simplication to the callback code is welcome!  Thanks for cleaning
this one up.

With a few commit msg nits,
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>

-- Joe

  parent reply	other threads:[~2019-01-21 22:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 16:17 [PATCH 0/4] livepatch: Followup changes for the atomic replace patchset Petr Mladek
2019-01-16 16:17 ` [PATCH 1/4] livepatch: Introduce klp_for_each_patch macro Petr Mladek
2019-01-21 12:10   ` Miroslav Benes
2019-01-21 22:34   ` Joe Lawrence
2019-01-16 16:17 ` [PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest Petr Mladek
2019-01-21 12:14   ` Miroslav Benes
2019-01-30  8:46     ` Petr Mladek
2019-01-31  8:40       ` Miroslav Benes
2019-01-21 22:40   ` Joe Lawrence
2019-01-30  8:56     ` Petr Mladek
2019-01-16 16:17 ` [PATCH 3/4] livepatch: Module coming and going callbacks can proceed all listed patches Petr Mladek
2019-01-21 14:45   ` Miroslav Benes
2019-01-21 22:47   ` Joe Lawrence [this message]
2019-01-16 16:17 ` [PATCH 4/4] livepatch: Remove the redundant enabled flag in struct klp_patch Petr Mladek
2019-01-21 22:50   ` Joe Lawrence
2019-01-22 10:06   ` Miroslav Benes
2019-01-23 18:27     ` Joe Lawrence
2019-01-29 20:00       ` Josh Poimboeuf
2019-01-30  9:44         ` Petr Mladek
2019-02-01 16:03 ` [PATCH 0/4] livepatch: Followup changes for the atomic replace patchset Joe Lawrence
2019-02-04  9:40   ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190121224728.GC8766@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=eshatokhin@virtuozzo.com \
    --cc=jbaron@akamai.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).