mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Balaji Rao <balajirrao@gmail.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: Greg KH <gregkh@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: 2.6.25 sysdev API problem
Date: Sun, 9 Mar 2008 02:27:55 +0530	[thread overview]
Message-ID: <200803090227.55230.balajirrao@gmail.com> (raw)
In-Reply-To: <20080308184717.GA7476@suse.de>

On Sunday 09 March 2008 12:17:17 am Greg KH wrote:
> On Sat, Mar 08, 2008 at 04:56:39PM +0100, Mikael Pettersson wrote:
> > In kernels up to and including 2.6.24, it was possible to
> > register-then-unregister a sysdev_class/sys_device pair
> > multiple times. Starting with the 2.6.24-git1 kernel, doing
> > so causes a warning
> >
> > kobject (f88e96c8): tried to init an initialized object, something is
> > seriously wrong
>
> This is a warning only, I have a patch queued up to fix this.  I've
> included it below.
>
> > the second time the class/device pair is registered, followed
> > soon thereafter by random BUG()s and a kernel panic.
>
> That's odd.  I don't think that is related, but it might be.  Can you
> try the patch and let me know if it still happens?
>
> thanks,
>
> greg k-h
>
>
> From: Balaji Rao <balajirrao@gmail.com>
> Date: Thu, 6 Mar 2008 22:23:18 +0530
> Subject: kobjects: mark cleaned up kobjects as unitialized
> To: gregkh@suse.de
> Cc: <kvm-devel@lists.sourceforge.net>, linux-kernel@vger.kernel.org
> Message-ID: <200803062223.18857.balajirrao@gmail.com>
> Content-Disposition: inline
>
>
> 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>
>
> ---
>  lib/kobject.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> --- a/lib/kobject.c
> +++ b/lib/kobject.c
> @@ -577,6 +577,9 @@ static void kobject_cleanup(struct kobje
>  		pr_debug("kobject: '%s': free name\n", name);
>  		kfree(name);
>  	}
> +
> +	/* Set the state to uninitialized */
> +	kobj->state_initialized = 0;
>  }
>
>  static void kobject_release(struct kref *kref)
Hi Mikael,

The above patch causes slab corruptions as shown by this thread.
http://lkml.org/lkml/2008/3/8/94

I've posted a test fix there. Please watch this thread for updates.

-- 
regards,
balaji rao
3rd year,
Dept. of Mechanical Engineering,
National Institute of Technology, Karnataka

      parent reply	other threads:[~2008-03-08 21:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-08 15:56 Mikael Pettersson
2008-03-08 18:47 ` Greg KH
2008-03-08 20:38   ` Mikael Pettersson
2008-03-08 20:57   ` Balaji Rao [this message]

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=200803090227.55230.balajirrao@gmail.com \
    --to=balajirrao@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    /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

all inboxes | Powered by JetHome®