[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150523132309.GA8636@dhcp-128-1.nay.redhat.com>
Date: Sat, 23 May 2015 21:23:09 +0800
From: Minfei Huang <mhuang@...hat.com>
To: Jiri Slaby <jslaby@...e.cz>
Cc: Minfei Huang <mnfhuang@...il.com>, Jiri Kosina <jkosina@...e.cz>,
live-patching@...r.kernel.org, jpoimboe@...hat.com,
sjenning@...hat.com, vojtech@...e.cz, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] livepatch: introduce patch/func-walking helpers
On 05/20/15 at 09:11am, Jiri Slaby wrote:
> On 05/20/2015, 03:51 AM, Minfei Huang wrote:
> > Sure. Sorry for confuse you with my comment.
>
> Oh, I see now, but:
>
> > list_for_each_entry(patch, &klp_patches, list) {
> > for (obj = patch->objs; obj->funcs; obj++) {
> > ----------------------------------
> > We get the fisrt object from the patch, then we break the loop. The code is more clearly to
> > use "if", instead of the loop.
> > ----------------------------------
> > if (!klp_is_module(obj) || strcmp(obj->name, mod->name))
> > continue;
>
> See 'continue' here. This *is* a loop and we do not fetch the first
> object. We look for the one with the same name.
>
> > if (action == MODULE_STATE_COMING) {
> > obj->mod = mod;
> > klp_module_notify_coming(patch, obj);
> > } else /* MODULE_STATE_GOING */
> > klp_module_notify_going(patch, obj);
> >
> > break;
> > ----------------------------------
> > Here we break the loop.
>
> Only if we found the one.
>
Hi, Jiri.
Ooops!
Since it is impossible for the differect objects which have the some
name in one patch, it is right to break the loop once we find a matched
object. It confuses me with the logic in __klp_enable_patch.
Thanks for your explanation.
Thanks
Minfei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists