[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.21.1905071355430.7486@pobox.suse.cz>
Date: Tue, 7 May 2019 14:32:57 +0200 (CEST)
From: Miroslav Benes <mbenes@...e.cz>
To: Petr Mladek <pmladek@...e.com>
cc: Jiri Kosina <jikos@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>,
"Tobin C . Harding" <tobin@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] livepatch: Remove custom kobject state handling
On Fri, 3 May 2019, Petr Mladek wrote:
> kobject_init() always succeeds and sets the reference count to 1.
> It allows to always free the structures via kobject_put() and
> the related release callback.
>
> Note that the custom kobject state handling was used only
> because we did not know that kobject_put() can and actually
> should get called even when kobject_init_and_add() fails.
>
> The patch should not change the existing behavior.
Pity that the changelog does not describe the change from
kobject_init_and_add() to two-stage kobject init (separate kobject_init()
and kobject_add()).
Petr changed it, because now each member of new dynamic lists (created in
klp_init_patch_early()) is initialized with kobject_init(), so we do not
have to worry about calling kobject_put() (this is slightly different from
kobj_added).
It would also be possible to retain kobject_init_and_add() and move it to
klp_init_patch_early(), but it would be uglier in my opinion.
Miroslav
Powered by blists - more mailing lists