[lkml]   [2002]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Why /dev/sdc1 doesn't show up...
> right).  Or you can run a notifier on "enlivening" a module: I'd hoped
> to avoid that.

Actually, after some thought, this seems to clearly be the Right
Thing, because it solves another existing race. Consider a module
which does:

if (!register_foo(&my_foo))
goto cleanup;
if (!create_proc_entry(&my_entry))
goto cleanup_foo;

If register_foo() calls /sbin/hotplug, the module can still fail to
load and /sbin/hotplug is called for something that doesn't exist.
With the new module loader, you can also have /sbin/hotplug try to
access the module before it's gone live, which will fail to prevent
the "using before we know module won't fail init" race.

Now, if you run /sbin/hotplug out of a notifier which is fired when
the module actually goes live, this problem vanishes. It also means
we can block module unload until /sbin/hotplug is run.

The part that makes this feel like the Right Thing is that adding to

notifier_call_chain(&module_notifiers, MODULE_LIVE, NULL);

means that /sbin/hotplug is called for everything which was registered
at boot. (We may not want to do this, but in general the symmetry
seems really nice).

[ Note: the logic for /sbin/hotplug applies to any similar "publicity"
function which promises that something now exists. ]

Al, thoughts?
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
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:31    [W:0.061 / U:2.988 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site