Thread (3 messages) flat view 3 messages, 2 authors, 2012-09-17

Re: [PATCH 2/2] module: wait when loading a module which is currently initializing.

From: Rusty Russell <hidden>
Date: 2012-09-17 11:36:09
Also in: lkml

Lucas De Marchi [off-list ref] writes:
quoted
-       if (find_module(mod->name)) {
+       if ((old = find_module(mod->name)) != NULL) {
+               if (old->state == MODULE_STATE_COMING) {
+                       /* Wait in case it fails to load. */
+                       mutex_unlock(&module_mutex);
+                       err = wait_event_interruptible(module_wq,
+                                              finished_loading(mod->name));
+                       if (err)
+                               goto free_arch_cleanup;
+                       goto again;
I wonder if we should indeed retry in case the module failed to load
or if we should just skip straight to returning the error code. We
don't have the return code for the failed load, but maybe we can
fabricate one here.

Thoughts?
Could have different cmdline parameters, or other randomness like
out-of-memory.  I think this is safest.

Cheers,
Rusty.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help