From: James Bottomley <James.Bottomley@steeleye.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Patrick Mansfield <patmans@us.ibm.com>,
Mike Anderson <andmike@us.ibm.com>,
SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] fix sd open/remove race
Date: 09 Apr 2004 13:45:38 -0500 [thread overview]
Message-ID: <1081536338.2203.107.camel@mulgrave> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0404091419520.1932-100000@ida.rowland.org>
On Fri, 2004-04-09 at 13:29, Alan Stern wrote:
> I want to prevent anyone from acquiring a reference to the
> object after the driver has decided that no more references
> should be given out, i.e., after sd_remove has been called.
> Hence I use the semaphore around the get and in the remove.
Well, but I think you're going to spend a lot of effort trying to do
this. I'm not convinced it's worth it.
Think of the CD ROM unplug that started all this. Supposing the user
opens the CD, waits a minute, disconnects it then tries to use the open
fd. Both of our schemes are forced to keep the object around giving EIO
until the user gets bored and closes it.
since we have to support the open degraded object anyway, why worry
about mediating open/disconnect races the only result of which would be
to refuse the open if it occurs within the correct window with the
disconnect?
> There's a somewhat similar problem that arises in the relation between the
> SCSI core and the low-level drivers. Here the data structure in question
> is the host template. (Yes, LLDs don't normally deallocate their host
> templates, but if they are built as modules they can be unloaded from
> memory, which has the same effect.) After calling scsi_remove_host() the
> LLD has no way to know when the SCSI core is finished using the template.
>
> Mike Anderson has suggested that scsi_remove_host could replace the hostt
> pointer with a pointer to a dummy template that will fail every operation.
> There may still be difficulties involving the procfs interface, though.
Yes, well, the host needs a proper lifecycle state model to begin with.
I'm afraid I've been concentrating on getting the device sorted out
first.
James
next prev parent reply other threads:[~2004-04-09 18:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040408115148.A12041@beaverton.ibm.com>
2004-04-09 14:11 ` [PATCH] fix sd open/remove race Alan Stern
2004-04-09 14:28 ` James Bottomley
2004-04-09 15:24 ` Alan Stern
2004-04-09 15:35 ` James Bottomley
2004-04-09 15:55 ` Alan Stern
2004-04-09 16:08 ` James Bottomley
2004-04-09 18:29 ` Alan Stern
2004-04-09 18:45 ` James Bottomley [this message]
2004-04-09 19:58 ` Alan Stern
2004-04-07 3:25 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=1081536338.2203.107.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=andmike@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=patmans@us.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox