linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Li Bin <huawei.libin@huawei.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	Seth Jennings <sjenning@redhat.com>,
	Vojtech Pavlik <vojtech@suse.cz>, Jiri Slaby <jslaby@suse.cz>,
	Miroslav Benes <mbenes@suse.cz>,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	lizefan@huawei.com, guohanjun@huawei.com,
	zhangdianfang@huawei.com, xiexiuqi@huawei.com
Subject: Re: [PATCH 2/2] livepatch: disable/enable_patch manners for interdependent patches
Date: Thu, 22 Jan 2015 07:05:19 -0600	[thread overview]
Message-ID: <20150122130519.GA17376@treble.redhat.com> (raw)
In-Reply-To: <54C0C8CF.8070804@huawei.com>

On Thu, Jan 22, 2015 at 05:54:23PM +0800, Li Bin wrote:
> On 2015/1/22 16:39, Li Bin wrote:
> > On 2015/1/22 11:51, Josh Poimboeuf wrote:
> >> On Thu, Jan 22, 2015 at 08:42:29AM +0800, Li Bin wrote:
> >>> On 2015/1/21 22:08, Jiri Kosina wrote:
> >>>> On Wed, 21 Jan 2015, Li Bin wrote:
> >>>> By this you limit the definition of the patch inter-dependency to just 
> >>>> symbols. But that's not the only way how patches can depend on it other -- 
> >>>> the dependency can be semantical.
> >>>
> >>> Yes, I agree with you. But I think the other dependencies such as semantical
> >>> dependency should be judged by the user, like reverting a patch from git repository.
> >>> Right?
> >>
> >> But with live patching, there are two users: the patch creator (who
> >> creates the patch module) and the end user (who loads it on their
> >> system).
> >>
> >> We can assume the patch creator knows what he's doing, but the end user
> >> doesn't always know or care about low level details like patch
> >> dependencies.  The easiest and safest way to protect the end user is the
> >> current approach, which assumes that each patch depends on all
> >> previously applied patches.
> > 
> > But then, the feature that disable patch dynamically is useless.
> > For example, if user find a bug be introduced by the last patch and disable
> > it directly, the new patch is no longer allowed from now unless enable the
> > old patch firstly but there is a risk window by this way.
> > 
> 
> Ok, in this case we can unregister the old patch firstly.
> But it seems that the feature that enable/disable patch dynamically indeed
> useless. (Its value is only for the last patch to enable or disable.)

I wouldn't say it's useless... It's just a patch stack.  If there's a
bug at the bottom of the stack, you can either:

1) push a new patch which does the opposite of the original patch
   (similar to how "git revert" adds a new commit);

2) or pop everything off the stack and create a new stack to your
   liking.

It doesn't actually prevent you from doing what you want, it just makes
it less convenient (and more safe IMO).

I suppose an alternative would be to allow the patch creator to specify
patch dependencies (in addition to something like your patch to catch
the obvious dependencies).  But dependencies are tricky and I'm not
really convinced that would be worth the added risk and code complexity.

-- 
Josh

  reply	other threads:[~2015-01-22 13:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21  9:07 [PATCH 0/2] disable/enable_patch manners for interdependent patches Li Bin
2015-01-21  9:07 ` [PATCH 1/2] livepatch: Revert "livepatch: enforce patch stacking semantics" Li Bin
2015-01-21 14:06   ` Jiri Kosina
2015-01-21 14:36     ` Seth Jennings
2015-01-22  0:44       ` Li Bin
2015-01-22  1:01   ` Li Bin
2015-01-22  9:15     ` Miroslav Benes
2015-01-22  9:42       ` Li Bin
2015-01-21  9:07 ` [PATCH 2/2] livepatch: disable/enable_patch manners for interdependent patches Li Bin
2015-01-21 14:08   ` Jiri Kosina
2015-01-22  0:42     ` Li Bin
2015-01-22  3:51       ` Josh Poimboeuf
2015-01-22  8:39         ` Li Bin
2015-01-22  9:54           ` Li Bin
2015-01-22 13:05             ` Josh Poimboeuf [this message]
2015-01-23  1:08               ` Li Bin

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=20150122130519.GA17376@treble.redhat.com \
    --to=jpoimboe@redhat.com \
    --cc=guohanjun@huawei.com \
    --cc=huawei.libin@huawei.com \
    --cc=jkosina@suse.cz \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mbenes@suse.cz \
    --cc=sjenning@redhat.com \
    --cc=vojtech@suse.cz \
    --cc=xiexiuqi@huawei.com \
    --cc=zhangdianfang@huawei.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).