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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kay Sievers
Date: Tuesday, October 23, 2007 - 4:27 am

On Tue, 2007-10-23 at 00:14 -0400, Alan Stern wrote:

That's the thing. We see a circular reference when we use the SCSI LUN
as the parent.
The sysfs relationship is: scsi_device -> genhd -> queue, while the
queue holds a ref to to the blockdev (parent), the blockdev to the
scsi_device (parent) and the scsi_devices to the queue (SCSI). All
waiting for their release functions to be called, to release the other
refs.

The scsi_device needs to drop the queue reference while the device is
removed, not when it's data is released. Hannes came up with the
attached patch, which seems to work fine here.


Right, that makes things very complicated.


Sounds good to me, to disconnect a dead object from its parent when it's
deleted. We only need to protect for "use after free" but not lock the
parent, I guess. We should give it a try.

Thanks,
Kay
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: BUG in: Driver core: convert block from raw kobjects t ..., Kay Sievers, (Tue Oct 23, 4:27 am)