From: Andrew Morton <akpm@linux-foundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: greg@kroah.com, kay.sievers@vrfy.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Kobjects: drop child->parent ref at unregistration
Date: Mon, 26 Nov 2007 14:58:10 -0800 [thread overview]
Message-ID: <20071126145810.eb848f23.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0711191047230.4806-100000@iolanthe.rowland.org>
On Mon, 19 Nov 2007 10:53:40 -0500 (EST)
Alan Stern <stern@rowland.harvard.edu> wrote:
> This patch (as1015) reverts changes that were made to the driver core
> about four years ago. The intent back then was to avoid certain kinds
> of invalid memory accesses by leaving kernel objects allocated as long
> as any of their children were still allocated. The original and
> correct approach was to wait only as long as any children were still
> _registered_; that's what this patch reinstates.
What happened with this?
> This fixes a problem in the SCSI core made visible by the class_device
> to regular device conversion: A reference loop (scsi_device holds
> reference to request_queue, which is the child of a gendisk, which is
> the child of the scsi_device) prevents the data structures from being
> released, even though they are deregistered okay.
>
> It's possible that this change will cause a few bugs to surface,
> things that have been hidden for several years. They can be fixed
> easily enough by having the child device take an explicit reference to
> the parent whenever needed.
>
How will such bugs manifest? Ideally via a nice printk and a stack trace
followed by damage avoidance.
If it's via a mysterious crash or something similarly obscure then can we
improve that?
next prev parent reply other threads:[~2007-11-26 22:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 15:53 [PATCH] Kobjects: drop child->parent ref at unregistration Alan Stern
2007-11-26 22:58 ` Andrew Morton [this message]
2007-11-27 2:29 ` Alan Stern
2007-11-27 17:01 ` Greg KH
2007-11-27 17:41 ` Alan Stern
2007-11-27 18:07 ` Greg KH
2007-11-27 20:31 ` Alan Stern
2007-11-29 21:14 ` patch kobject-drop-child-parent-ref-at-unregistration.patch added to gregkh-2.6 tree gregkh
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=20071126145810.eb848f23.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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