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

From: Alan Stern
Date: Fri Oct 19 2007 - 10:10:00 EST


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.

Alan Stern

-
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/