From: James Bottomley <James.Bottomley@SteelEye.com>
To: James.Smart@Emulex.Com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.scsi.org, tore@linepro.no
Subject: Re: [PATCH] add container release logic - update fc transport to utilize it
Date: Tue, 14 Aug 2007 14:17:54 -0500 [thread overview]
Message-ID: <1187119074.3393.30.camel@localhost.localdomain> (raw)
In-Reply-To: <1187266579.2918.15.camel@localhost.localdomain>
On Thu, 2007-08-16 at 08:16 -0400, James Smart wrote:
> Consistent with the code in the rest of the transports, when the driver
> module attached or detached to a transport, the transport ignored the
> statuses from transport_container_register() and transport_container_unregister().
> This was particularly bad on the unregister path, because the transport would
> free the transport-internal structure that held all the attribute
> containers. Thus, if a driver was told to unload, and the unload path
> completed faster than the tear down of the scsi object tree (as a sysfs attribute
> was in use at the time, or whatever), you could get into ugly reuse of a freed
> internal structure.
>
> Given that this is a module-global thing, there's no real relationship to
> the create/release (or refcounting) of the device objects that eventually
> bind to the structure.
>
> I modified the container logic to potentially call back the container owner
> whenever all objects on the container were freed. This allowed the release to
> happen in the background to the LLDD removal.
>
> Assuming this is how we want to handle this scenario, the other SCSI transports
> need to be updated accordingly.
I'm afraid if you look at your solution, you'll see it still doesn't
quite work: If the next thing the user does after unloading lpfc is to
unload the transport class, the module is blown away with potentially a
live release callback to now freed code.
Isn't a better way to handle it simply to give
transport_container_unregister() the semantics everyone is expecting
(i.e. to wait for everything to be tidied up and gone)? That way none
of the transport classes needs updating, and we don't have to handle the
rather nasty release and unload races.
James
next prev parent reply other threads:[~2007-08-14 19:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 18:27 [PATCH] add container release logic - update fc transport to utilize it James Smart
2007-08-14 19:17 ` James Bottomley [this message]
2007-08-14 19:26 ` James Smart
2007-08-14 19:39 ` 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=1187119074.3393.30.camel@localhost.localdomain \
--to=james.bottomley@steeleye.com \
--cc=James.Smart@Emulex.Com \
--cc=linux-kernel@vger.scsi.org \
--cc=linux-scsi@vger.kernel.org \
--cc=tore@linepro.no \
/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