Netdev List
 help / color / mirror / Atom feed
* __net_exit bogusly defined as __exit_refok ?
@ 2011-10-06 11:55 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2011-10-06 11:55 UTC (permalink / raw)
  To: davem, xemul; +Cc: netdev

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-06 11:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 11:55 __net_exit bogusly defined as __exit_refok ? Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox