public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Riffard <laurent.riffard@free.fr>
To: Greg KH <gregkh@suse.de>, Balaji Rao <balajirrao@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: Tree for March 7: slab corruptions
Date: Sun, 09 Mar 2008 09:13:19 +0100	[thread overview]
Message-ID: <47D39C1F.6030900@free.fr> (raw)
In-Reply-To: <20080309030559.GA24355@suse.de>

Le 09.03.2008 04:05, Greg KH a écrit :
> On Sun, Mar 09, 2008 at 12:29:48AM +0530, Balaji Rao wrote:
>> On Saturday 08 March 2008 04:15:22 pm Laurent Riffard wrote:
>>> Le 07.03.2008 04:18, Stephen Rothwell a ??crit :
>>>> Hi all,
>>>>
>>>> I have created today's linux-next tree at
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git
>>> I've got a lot of "Slab corruption" with next-20060307 (actually a
>>> continuous flow of warnings) whereas next-20060306 is fine.
>>>
[snip]
>>>
>>> I did a bisection:
>>>
>>> 5a428808720b31026890d3ff71fbd891d9a94fd6 is first bad commit
>>> commit 5a428808720b31026890d3ff71fbd891d9a94fd6
>>> Author: Balaji Rao <balajirrao@gmail.com>
>>> Date:   Thu Mar 6 22:23:18 2008 +0530
>>>
>>>     kobjects: mark cleaned up kobjects as unitialized
>>>
>>>     When I remove only the kvm-intel module without removing the kvm module
>>>     itself, I get an error saying that a kobject is trying to be
>>>     reinitialized. Its because of the fact that kvm reuses a kobject in
>>>     kvm_init when calling sysdev_register.
>>>
>>>     This patch fixes kobject_cleanup by marking the kobject as
>>> uninitialized when we cleanup to allow kobjects to be reused.
>>>
>>>     Signed-off-by: Balaji Rao <balajirrao@gmail.com>
>>>     Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>>>
>>> :040000 040000 c15d08d966391dec783d137558fad66d9c2da57b
>>> : eddea2ec69c014370cf98cc2fc7e24a8dc301e70 M     lib
>>>
>>> .config attached
>>> ~~
>>> laurent
>> Hi greg,
>>
>> Apparently, its the wrong place to mark the kobject as uninitialized as the 
>> kobject could be freed by then. I've now moved it to the top of 
>> kobject_cleanup(). This fixes the problem for me.
>>
>> laurent, can you please revert the above commit , and apply this patch ? Does 
>> it help ?
>>
>> Signed-off-by: Balaji Rao <balajirrao@gmail.com>

Yes, it does help, all the "Slab corruptions" warnings are gone.
Thanks.

Tested-by: Laurent Riffard <laurent.riffard@free.fr>

>>
>> diff --git a/lib/kobject.c b/lib/kobject.c
>> index d784dae..a1f87bd 100644
>> --- a/lib/kobject.c
>> +++ b/lib/kobject.c
>> @@ -548,6 +548,9 @@ static void kobject_cleanup(struct kobject *kobj)
>>         pr_debug("kobject: '%s' (%p): %s\n",
>>                  kobject_name(kobj), kobj, __FUNCTION__);
>>  
>> +       /* Set the state to uninitialized */
>> +       kobj->state_initialized = 0;
>> +
>>         if (t && !t->release)
>>                 pr_debug("kobject: '%s' (%p): does not have a release() "
>>                          "function, it is broken and must be fixed.\n",
>>
>>
> 
> Doh, this is correct, sorry about that, I'll fix this up properly...
> 
> thanks,
> 
> greg k-h

  reply	other threads:[~2008-03-09  8:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07  3:18 linux-next: Tree for March 7 Stephen Rothwell
2008-03-07  4:39 ` Greg KH
2008-03-08 10:45 ` linux-next: Tree for March 7: slab corruptions Laurent Riffard
2008-03-08 18:59   ` Balaji Rao
2008-03-09  3:05     ` Greg KH
2008-03-09  8:13       ` Laurent Riffard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-02-05  5:08 Zhao, Yu
2009-02-05  5:38 ` Greg KH
2009-02-05  7:27   ` Zhao, Yu
2009-02-05 15:26     ` Greg KH

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=47D39C1F.6030900@free.fr \
    --to=laurent.riffard@free.fr \
    --cc=balajirrao@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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