From: "Jan Beulich" <JBeulich@suse.com>
To: <davem@davemloft.net>, <xemul@openvz.org>
Cc: <netdev@vger.kernel.org>
Subject: __net_exit bogusly defined as __exit_refok ?
Date: Thu, 06 Oct 2011 12:55:23 +0100 [thread overview]
Message-ID: <4E8DB34B0200007800059AA5@nat28.tlf.novell.com> (raw)
Realizing that this has been this way a for a rather long time, I still wonder
why it was done that way: __exit_refok (evaluating to __ref) allows these
functions to reference __init functions and __initdata objects (which is
wrong, since those can get called in the context of __exit code, at which
point .init.* sections are already gone).
Second, __exit_refok results in the code to not be discarded at all
(with the original patch's description wrongly indicating that without
NET_NS the exit functions would never be called - they get called from
unregister_pernet_operations(), which generally gets invoked from
modules' __exit sections), which is the same as if no section
placement annotation was present.
Thus, rather than being the only user of __exit_refok (which by itself
is a dubious construct), it would seem to make more sense to make
__net_exit resolve to nothingregardless of NET_NS (short of going
through the code and remove all uses of it) and delete __exit_refok.
One alternative might be to make __net_exit at least resolve to
__init_or_module, as __exit functions won't be called without
MODULES. Or really, you'd want something that resolves to __init
when built into the kernel, and to nothing when built as a module.
Both, however, would require some adjustments to modpost's
section mismatch checking.
Jan
reply other threads:[~2011-10-06 11:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4E8DB34B0200007800059AA5@nat28.tlf.novell.com \
--to=jbeulich@suse.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=xemul@openvz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox