From: Rusty Russell <rusty@rustcorp.com.au>
To: corbet@lwn.net (Jonathan Corbet)
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] Allow arbitrary number of init funcs in modules
Date: Tue, 24 Jun 2003 12:29:34 +1000 [thread overview]
Message-ID: <20030624023802.5D4DA2C04C@lists.samba.org> (raw)
In-Reply-To: Your message of "Mon, 23 Jun 2003 13:11:41 CST." <20030623191141.31814.qmail@eklektix.com>
In message <20030623191141.31814.qmail@eklektix.com> you write:
> > Feedback is extremely welcome,
>
> OK...you asked for it. I found three separate bugs, two of them oopsed the
> system, and the other prevented module unloading. Did you try it with
> CONFIG_MODULE_UNLOAD? :) You also need to test for null init functions,
> because the module_init/module_exit mode creates them. Patch appended.
Wow, someone actually tested it! I do sometimes wonder.
It turns out that I tested an older version with modules, and only
tested this rewrite with in-built code. Mea culpa.
> Also...some guy once posted (http://lwn.net/Articles/22763/):
>
> I appeciate the series in modernizing modules, but just FYI, I
> don't think the old-style init_module/cleanup_module stuff will
> break any time soon: there are still a large number of drivers
> which use it, and there's not much point making such changes.
>
> This patch breaks the old init_module/cleanup_module scheme; those
> functions no longer get called. Was that intentional?
<SIGH> I'd forgotten about that; there are about 100 places where this
technique is still used. The change would be trivial, but this isn't
2.5.lownum anymore. Workaround incorporated.
> P.S. Beyond that, I think the patch makes sense :)
Thanks...
> --- 2.5.73-rr/kernel/module.c Tue Jun 24 02:58:32 2003
> +++ 2.5.73/kernel/module.c Tue Jun 24 03:00:36 2003
> @@ -617,9 +617,10 @@
> {
> int i, balance = 0;
>
> - for (i = 0; i < num_pairs; i++)
> + for (i = 0; i < num_pairs; i++) {
> balance += (pairs->init ? 1 : 0) - (pairs->exit ? 1 : 0);
> -
> + pairs++;
> + }
> return balance == 0;
> }
>
I prefer to use pairs[i].init. Rest applied untouched.
I'll test and release a new on soon...
Thanks!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next prev parent reply other threads:[~2003-06-24 2:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-23 9:19 [PATCH 3/3] Allow arbitrary number of init funcs in modules Rusty Russell
2003-06-23 19:11 ` Jonathan Corbet
2003-06-24 2:29 ` Rusty Russell [this message]
2003-06-24 6:57 ` Rusty Russell
2003-06-24 20:06 ` Horst von Brand
2003-06-24 17:01 ` Roman Zippel
2003-06-25 3:10 ` Rusty Russell
2003-06-25 10:30 ` Roman Zippel
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=20030624023802.5D4DA2C04C@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=corbet@lwn.net \
--cc=linux-kernel@vger.kernel.org \
/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.