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

From: Kay Sievers
Date: Fri Oct 19 2007 - 10:14:38 EST



On Fri, 2007-10-19 at 10:09 -0400, Alan Stern wrote:
> On Fri, 19 Oct 2007, Kay Sievers wrote:
>
> > > This accounts for everything in del_gendisk except the final
> > > put_device. Evidently it doesn't belong there. There's no matching
> > > get_device in add_disk or register_disk.
> >
> > Hmm, do you have kobject debugging enabled? Do you ever see something
> > like: "kobject sdb: cleaning up" when you remove the put_device()?
>
> I didn't enable kobject debugging, but I did put a printk statement in
> drivers/scsi/sd.c:scsi_disk_release(), which is the release routine for
> the scsi_disk structure. It does the final put_disk() call -- or at
> least, this is _supposed_ to be the final call.
>
> With my patch, just before the call to put_disk the value of
> disk->dev.kobj.kref.refcount is 1. Without my patch, the value is
> garbage (probably a slab poison value, but I printed it in decimal
> rather than hex so I can't be sure).
>
> Don't you have a USB storage device? It should be easy for you to test
> this on your own system.

Sure, I have, and tried a lot of times, and all seemed correct here with
the final put. I don't say that it's the right fix, but without it, the
disk device object is never released here, it only gets removed from
sysfs.

Kay

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