Skip to contentSkip to conversation

Proposed module init race fix.

PATCH Adam J. Richter 2 participants 2 messages Jan 15, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Rusty Russell

It's possible to start using a module, and then have it fail initialization. In 2.4, this resulted in random behaviour. One solution to this is to make all interfaces two-stage: reserve everything you need (which might fail), the activate them. This means changing about 1600 modules, and deprecating every interface they use.

Could you explain this "random behavior" of 2.4 a bit more?
As far as I know, if a module's init function fails, it must unregister everything that it has registered up to that point.

Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America

"Free Software For The Rest Of Us."

#1 lore raw

In message <[email protected]> you write:

Quoted 11 lines · Rusty Russell
Quoted 6 lines

It's possible to start using a module, and then have it fail initialization. In 2.4, this resulted in random behaviour. One solution to this is to make all interfaces two-stage: reserve everything you need (which might fail), the activate them. This means changing about 1600 modules, and deprecating every interface they use.

Could you explain this "random behavior" of 2.4 a bit more?
As far as I know, if a module's init function fails, it must unregister everything that it has registered up to that point.

And if someone's using it, the module gets unloaded underneath them.

Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.