In fact, it's backwards. Currently we *do* allow try_module_get()
during init:
/* FIXME: It'd be nice to isolate modules during init, too, so they
aren't used before they (may) fail. But presently too much code
(IDE & SCSI) require entry into the module during init. */
static inline int module_is_live(struct module *mod)
{
return mod->state != MODULE_STATE_GOING;
}
This probably won't change before 2.6: sure, there are races, but
we've lived with them so far. I don't like it, but that's the
Realpolitik of the Linux Kernel.
There are a few ways of fixing it. Viro suggested every interface be
explicitly split into "reserve and commit". To put it mildly, I shy
away from changing every module for an obscure race which so few
people understand anyway. There's the make_module_live() function,
where a module says "I'm finished init already". Of course, you can't
fail initialization after this. Or, the current module notifier could
be extended, to have an event after module init.
None of these would be one-liners for IPv6, AFAICT.
Hope that clarifies,
Rusty.
-- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/