Re: BUG in: Driver core: convert block from raw kobjects to core devices

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Kay Sievers <kay.sievers@...>
Cc: Greg KH <greg@...>, Kernel development list <linux-kernel@...>, Hannes Reinecke <hare@...>
Date: Wednesday, October 24, 2007 - 2:01 pm

On Tue, 23 Oct 2007, Kay Sievers wrote:


I found out why it works on my system -- which still leaves open the 
question of why it fails on yours.

Although the gendisk device is a child of the scsi_device, nevertheless 
disk->kobj is not a child of the scsi_device's embedded kobject.  
Instead it is a child of the static (!) block_depr kobject, which is 
defined in block/genhd.c.  Hence the disk's single reference to the 
scsi_device is indeed dropped when the disk is unregistered, which 
breaks the loop of circular references.

It works this way because I have CONFIG_SYSFS_DEPRECATED set; perhaps
you don't.  If you compare the two versions of get_device_parent() in
drivers/base/core.c you'll see the difference (it's the dev_type ==
&disk_type case).

Alan Stern

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: BUG in: Driver core: convert block from raw kobjects to ..., Alan Stern, (Wed Oct 24, 2:01 pm)