From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Tomas Henzl <thenzl@redhat.com>,
Mike Christie <michaelc@cs.wisc.edu>,
"'linux-scsi@vger.kernel.org'" <linux-scsi@vger.kernel.org>,
Stanislaw Gruszka <sgruszka@redhat.com>
Subject: Re: [RFC] How to fix an async scan - rmmod race?
Date: Fri, 06 Apr 2012 18:15:25 +0100 [thread overview]
Message-ID: <1333732525.2953.16.camel@dabdike> (raw)
In-Reply-To: <4F7F214D.20500@acm.org>
On Fri, 2012-04-06 at 17:01 +0000, Bart Van Assche wrote:
> On 04/06/12 16:35, James Bottomley wrote:
>
> > On Fri, 2012-04-06 at 16:15 +0000, Bart Van Assche wrote:
> >> As far as I can see the queuecommand call in scsi_dispatch_cmd() can
> >> race with module removal - that call can be triggered while the host
> >> template is being unloaded. I'm not sure though what the best approach
> >> is to fix that race.
> >
> > Um, it's a bit hard to see how. It's not really possible to trigger
> > queuecommand except in the initial probe without an open device ... and
> > opening the device holds the module.
>
>
> Sorry, but I forgot to mention that it's not just scsi_dispatch_cmd()
> that invokes queuecommand via the host template. The SCSI error handler
> does that too. As far as I can see there is no protection in the SCSI
> error handler against LLD module removal. But maybe I overlooked something.
Consider where the command came from: either it's come from startup (the
current problem), operation (in which case the device must be open to
send and receive it) or teardown (which is synchronous).
James
next prev parent reply other threads:[~2012-04-06 17:15 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 13:58 [RFC] How to fix an async scan - rmmod race? Tomas Henzl
2012-04-05 15:57 ` Mike Christie
2012-04-05 16:05 ` Mike Christie
2012-04-05 18:00 ` Bart Van Assche
2012-04-05 21:29 ` Mike Christie
2012-04-06 9:24 ` Bart Van Assche
2012-04-06 17:22 ` Mike Christie
2012-04-06 18:37 ` Bart Van Assche
2012-04-11 21:46 ` Mike Christie
2012-04-06 9:54 ` Tomas Henzl
2012-04-06 15:20 ` James Bottomley
2012-04-06 16:15 ` Bart Van Assche
2012-04-06 16:35 ` James Bottomley
2012-04-06 17:01 ` Bart Van Assche
2012-04-06 17:15 ` James Bottomley [this message]
2012-04-06 17:59 ` Bart Van Assche
2012-04-08 17:38 ` Bart Van Assche
2012-04-11 18:17 ` Mike Christie
2012-04-11 18:30 ` Mike Christie
2012-04-11 19:47 ` Bart Van Assche
2012-04-11 22:28 ` Mike Christie
2012-04-12 10:48 ` Bart Van Assche
2012-04-06 9:39 ` Bart Van Assche
2012-04-06 10:14 ` Tomas Henzl
2012-04-06 13:13 ` Tomas Henzl
2012-04-06 14:38 ` Bart Van Assche
2012-04-06 15:32 ` Tomas Henzl
2012-04-12 12:48 ` [RFC] How to fix an async scan - rmmod race? try_module_get Tomas Henzl
2012-04-18 16:48 ` [RFC] How to fix an async scan - 'rmmod --wait' race? Tomas Henzl
2012-04-18 18:18 ` Bart Van Assche
2012-05-17 8:42 ` James Bottomley
2012-05-17 8:55 ` Bart Van Assche
2012-05-17 9:01 ` James Bottomley
2012-05-17 14:51 ` Tomas Henzl
2012-05-22 10:05 ` James Bottomley
2012-05-25 15:13 ` Tomas Henzl
2012-05-25 18:46 ` Dan Williams
2012-05-28 11:58 ` Tomas Henzl
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=1333732525.2953.16.camel@dabdike \
--to=james.bottomley@hansenpartnership.com \
--cc=bvanassche@acm.org \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=sgruszka@redhat.com \
--cc=thenzl@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).