From: Patrick Mansfield <patmans@us.ibm.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>, greg@kroah.com
Subject: Re: [PATCH] update sd to use kref and fix open/release race
Date: Fri, 9 Apr 2004 12:57:37 -0700 [thread overview]
Message-ID: <20040409125737.A4996@beaverton.ibm.com> (raw)
In-Reply-To: <1081538374.2202.157.camel@mulgrave>; from James.Bottomley@SteelEye.com on Fri, Apr 09, 2004 at 02:19:34PM -0500
On Fri, Apr 09, 2004 at 02:19:34PM -0500, James Bottomley wrote:
> This looks odd. I'm guessing that scsi_device_set_state+0xa3/0xe4 is
> right around the dev_printk() in the illegal: label?
Yep.
> I'm guessing it did this because the driver had already detached so the
> dev->driver->name deref is the NULL pointer one.
>
> Really, we need to make dev_printk a lot more robust if it's actually
> going to be useful.
IMO we should have a sdev_printk not using dev_printk, as during
scan/remove time we use all the normal code paths, and we don't have a
driver bound at those times. We could also bind a "dummy" driver and still
use dev_printk, but that could be problematic given the removing and
adding races.
> Can you fix it and then tell me what the illegal
> state transition actually was?
OK.
> I guess it's because we don't drop off the siblings list until release
> time, and the device was already being deleted.
I ran the delete a few seconds before the modprobe -r, the delete should
have been complete. The device being deleted was not open at the time.
Here is the stack and debug output:
scsi device <6:0:3:0> Illegal state transition deleted->cancel
Badness in scsi_device_set_state at drivers/scsi/scsi_lib.c:1646
Call Trace:
[<c01ea4d8>] scsi_device_set_state+0xc8/0xd4
[<c01ec38a>] scsi_remove_device+0xe/0x88
[<c01eba32>] scsi_forget_host+0x32/0x60
[<c01e57cd>] scsi_remove_host+0x19/0x48
[<f88b5667>] qla2x00_remove_one+0x6f/0x8c [qla2xxx]
[<f88cf022>] qla2300_remove_one+0xa/0x10 [qla2300]
[<c01a5fe2>] pci_device_remove+0x1a/0x34
[<c01c77aa>] device_release_driver+0x46/0x58
[<c01c77d9>] driver_detach+0x1d/0x2c
[<c01c79b5>] bus_remove_driver+0x29/0x5c
[<c01c7ceb>] driver_unregister+0xb/0x1f
[<c01a6166>] pci_unregister_driver+0xe/0x1c
[<f88cf032>] qla2300_exit+0xa/0x10 [qla2300]
[<c012d0d5>] sys_delete_module+0x141/0x174
[<c01405f0>] sys_munmap+0x38/0x58
[<c0106b93>] syscall_call+0x7/0xb
next prev parent reply other threads:[~2004-04-09 19:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-09 13:52 [PATCH] update sd to use kref and fix open/release race James Bottomley
2004-04-09 16:56 ` Patrick Mansfield
2004-04-09 17:17 ` Patrick Mansfield
2004-04-09 19:19 ` James Bottomley
2004-04-09 19:32 ` Greg KH
2004-04-09 19:57 ` Patrick Mansfield [this message]
2004-04-13 17:12 ` Mike Anderson
2004-04-21 19:10 ` James Bottomley
2004-04-22 5:57 ` Mike Anderson
2004-04-22 6:56 ` viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040409125737.A4996@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@SteelEye.com \
--cc=greg@kroah.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox