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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 31 Oct 2007, James Bottomley wrote:

> But you're assuming the relationship gendisk->queue exists when we
> delete the scsi device.  What should happen is that the gendisk should
> be released first in the ULD detach.  Queues are allowed to exist
> without gendisks (when a SCSI queue is first created, that's what it
> should look like), so I think we're perhaps simply missing an API that
> would detach the queue and the gendisk (and get the gendisk to delete
> itself and give up its device link) ... doesn't del_gendisk() do this?

It tries to, but it fails.  What happens is del_gendisk() calls
unlink_gendisk(), which calls blk_unregister_queue().  If the kobject
core worked rationally, this would cause the queue to drop its
reference to the gendisk and allow the gendisk to be released.

But it doesn't.  The kobject core doesn't drop the reference from a
child to a parent when the child is unregistered; it waits until the
child is released.  This means that the gendisk can't be released until
the queue is released.  Similarly, the scsi_device can't be released 
until the gendisk is released.  And obviously this constitutes a deadly 
cycle.

The proposed patch will make the kobject core behave as it should, 
dropping references during unregister instead of waiting until release.

Alan Stern


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux