From: Hannes Reinecke <hare@suse.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Mike Anderson <andmike@us.ibm.com>,
Christoph Hellwig <hch@infradead.org>,
James Bottomley <James.Bottomley@SteelEye.com>,
SCSI Mailing List <linux-scsi@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>,
Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Subject: Re: [Patch] Fix oops on rmmod usb-storage
Date: Fri, 01 Oct 2004 09:11:12 +0200 [thread overview]
Message-ID: <415D0310.6020308@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0409301411240.1060-100000@ida.rowland.org>
Alan Stern wrote:
> On Thu, 30 Sep 2004, Hannes Reinecke wrote:
>
>
>>Ok, since this is essential the same thread then on linux-scsi
>>(cf. "Bug: CD driver sends commands during host removal") the same
>>solution applies here also.
>>
>>Alan, I did a different patch which omit the special case handling in
>>scsiglue.c and rather reorders usb_stor_control_thread. I'd prefer mine
>>(naturally), but any of those will do.
>>And yes, both patches fix the problem.
>>
>>Back to the maintainer for patch inclusion.
>>
>>Cheers,
>>
>>Hannes
>
>
> No, your patch is incorrect. In fact, it resembles the way the driver
> used to work -- which caused an occasional oops. The problem is that by
> the time the usb_stor_control_thread() wakes up and sees that it has a new
> command to process, the SCSI core may already have deallocated the
> scsi_cmnd structure. So the line where you assign to us->srb->result is
> liable to raise an addressing exception.
>
> Alan Stern
>
Ok. (I knew there was something subtle going on).
What about the check for disconnecting later in
usb.c:usb_stor_control_thread?
It will only trigger if usb_stor_control_thread has been awakened by
some other command and the device has been disconnected between
awakening and executing this check.
(This may well be impossible to trigger, but the set_bit() in
storage_disconnect() appears not to be protected by any lock).
And I doubt it will work properly in that case as no scsi_done is not
called nor a proper status is set.
Is this check still needed or can it be removed?
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux AG S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2004-10-01 7:11 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-29 7:43 [Patch] Fix oops on rmmod usb-storage Hannes Reinecke
2004-09-29 12:03 ` Christoph Hellwig
2004-09-29 12:31 ` Hannes Reinecke
2004-09-29 17:12 ` Mike Anderson
2004-09-29 17:19 ` James Bottomley
2004-09-29 17:22 ` Christoph Hellwig
2004-09-29 17:36 ` Mike Anderson
2004-09-29 17:38 ` Christoph Hellwig
2004-09-29 17:50 ` Alan Stern
2004-09-29 18:32 ` Mike Anderson
2004-09-29 18:58 ` Alan Stern
2004-09-30 8:09 ` Hannes Reinecke
2004-09-30 18:14 ` Alan Stern
2004-10-01 7:11 ` Hannes Reinecke [this message]
2004-10-01 16:07 ` Alan Stern
2004-09-29 17:52 ` Mike Anderson
2004-09-29 12:04 ` Alan Cox
2004-09-29 13:56 ` James Bottomley
2004-09-29 13:17 ` Alan Cox
2004-09-29 14:24 ` James Bottomley
2004-09-29 14:44 ` Hannes Reinecke
2004-09-29 15:15 ` James Bottomley
2004-09-29 15:15 ` James Bottomley
2004-09-29 15:28 ` Matthew Wilcox
2004-09-29 15:35 ` James Bottomley
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=415D0310.6020308@suse.de \
--to=hare@suse.de \
--cc=James.Bottomley@SteelEye.com \
--cc=akpm@osdl.org \
--cc=andmike@us.ibm.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=stern@rowland.harvard.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.