From: Rusty Russell <rusty@rustcorp.com.au>
To: Doug Ledford <dledford@redhat.com>
Cc: Linux Scsi Mailing List <linux-scsi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Alexander Viro <viro@math.psu.edu>,
Linus Torvalds <torvalds@transmeta.com>
Subject: Re: Why /dev/sdc1 doesn't show up...
Date: Mon, 18 Nov 2002 19:52:54 +1100 [thread overview]
Message-ID: <20021118085928.82D7F2C30D@lists.samba.org> (raw)
In-Reply-To: Your message of "Sun, 17 Nov 2002 14:52:58 CDT." <20021117195258.GC3280@redhat.com>
In message <20021117195258.GC3280@redhat.com> you write:
> Because module loading of any incestious, cross-locking modules is horked
> :-P
>
> NOTE: I suspect the same bug applies to IDE devices as well, but you
> wouldn't see it unless you compile your IDE drivers as modules and use
> initrd or equivelant to load the modules.
>
> Longer answer:
>
> Device scans happen almost exclusively at either host module init time or
> device module init time. At that point in time, either the host the
> device is on or the high level driver accessing the device will still be
> in it's init_module() routine. That, of course, implies that either
> host->hostt->module->live is 0 or that *_template->module->live is 0 (and
> consequently so is fops->owner->live == 0).
Yes, it's an interesting corner case. As I implied before, if a
module is register an interface, you do not need to try_module_get().
Why? Because *someone* already has a reference by definition (either
the module itself is calling you, or someone else with whom the module
registered).
Unfortunately, this does complicate code slightly if you other paths
which *do* need the try_module_get(). But the existence of this
interface is no accident: I know Al Viro wants to split every register
interface to "reserve" and "use", and make all modules use them
correctly, but I chose to avoid forcing such changes on all module
authors and all interface authors for good reason.
[ Mainly to Al ]:
I know what a PITA it is, because I implemented it a year ago. So
first the interface had to be changed to two-stage init, *then* the
module had to be changed to use it. If a module uses 5 interfaces,
that's a series of five patches, each one interlocked with the
corresponding interface. And implementing it showed me that authors
were unlikely to correctly use any interface more complex than the
current one 8(
And it *still* means you need two paths for your code: one for "I know
it's not actually "active" yet, but I'm doing init and I need to
access it anyway". So every interface gains significant complexity by
effectively implementing their own "live" flag...
> Suggestions Rusty?
Hope that helps,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next prev parent reply other threads:[~2002-11-18 8:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-17 19:52 Why /dev/sdc1 doesn't show up Doug Ledford
2002-11-17 20:01 ` Alexander Viro
2002-11-17 20:12 ` Doug Ledford
2002-11-17 20:16 ` Alexander Viro
2002-11-17 23:20 ` Andries Brouwer
2002-11-17 23:45 ` Doug Ledford
2002-11-18 8:52 ` Rusty Russell [this message]
2002-11-18 9:51 ` Alexander Viro
2002-11-18 23:49 ` Rusty Russell
2002-11-19 0:08 ` Linus Torvalds
2002-11-19 20:54 ` Rusty Russell
2002-11-20 15:45 ` Linus Torvalds
2002-11-24 22:30 ` Rusty Russell
2002-11-19 0:09 ` Doug Ledford
2002-11-19 20:58 ` Rusty Russell
2002-11-19 0:32 ` Alan Cox
2002-11-18 10:02 ` Roman Zippel
-- strict thread matches above, loose matches on Subject: below --
2002-11-19 5:52 Rusty Russell
2002-11-19 7:12 ` Alexander Viro
2002-11-19 21:29 ` Rusty Russell
2002-11-19 22:33 ` Andries Brouwer
2002-11-19 16:06 ` Doug Ledford
2002-11-19 17:55 ` Jeff Garzik
2002-11-19 21:42 ` Rusty Russell
2002-11-20 23:41 ` john slee
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=20021118085928.82D7F2C30D@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=dledford@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=torvalds@transmeta.com \
--cc=viro@math.psu.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