[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0710192156460.23656-200000@netrider.rowland.org>
Date: Sat, 20 Oct 2007 21:33:58 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Kay Sievers <kay.sievers@...y.org>
cc: Greg KH <greg@...ah.com>,
Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: BUG in: Driver core: convert block from raw kobjects to core
devices
On Sat, 20 Oct 2007, Kay Sievers wrote:
> Here is what I see, the error handler hangs without the final put and
> the kobject never gets cleaned up. Note the missing:
> kobject sdb: cleaning up
>
> What is your CONFIG_SYSFS_DEPRECATED option? I have it unset, and that
> may be the difference in the behavior if you have it set.
It's unset in my config also. No, the difference lies somewhere else.
The plug-in parts are the same, but we differ in the remove parts. On
your system, unlink_gendisk ends up dropping only one reference instead
of two. This suggests that something strange is happening to the
request_queue on your machine.
Can you try running the attached patch (without the previous patch)?
It traces the various release routines. The idea is that both the
scsi_disk and the scsi_device hold references to the request_queue,
and these references get dropped in their respective release routines.
Just for the record, here's what happens with this patch on my system,
without the put_device call in del_gendisk (the patch comments it out).
I plugged in a USB drive and let things settle down. Then unplugging
the drive gave this:
[ 457.916995] usb 6-4: USB disconnect, address 3
[ 457.918459] usb 6-4: unregistering device
[ 457.920570] usb 6-4: usb_disable_device nuking all URBs
[ 457.920859] usb 6-4: unregistering interface 6-4:1.0
[ 457.958990] disk_release: kobj cedcda50
The line above refers to the /dev/sda1 partition. Ignore it.
[ 458.012317] del_gendisk sda, kobj ce8be990, queue cd9b2000, refcount before put_device 2
2 references: one from the scsi_disk and one from the request_queue.
[ 458.013133] scsi_disk_release: disk sda, kobj ce8be990, refcount before put_disk 2
[ 458.032420] scsi_device_dev_release: rq cd9b2000
These lines show where the two references to the request_queue get
dropped. As a result the queue is released, causing the gendisk to be
released as well:
[ 458.032766] blk_release_queue: rq cd9b2000, parent ce8be990
[ 458.032973] disk_release: kobj ce8be990
[ 458.051641] usb 6-4:1.0: uevent
[ 458.052001] usb 6-4:1.0: uevent
[ 458.068665] usb 6-4: uevent
If you don't get a similar sequence of events, it must indicate that
something on your system continues to hold an outstanding reference.
Maybe an automounter program, or something like that.
Alan Stern
View attachment "disktest.txt" of type "TEXT/plain" (2546 bytes)
Powered by blists - more mailing lists