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

2012-09-17 Thread Lucas De Marchi
On Mon, Sep 17, 2012 at 1:36 AM, Rusty Russell wrote: > Lucas De Marchi writes: >>> - if (find_module(mod->name)) { >>> + if ((old = find_module(mod->name)) != NULL) { >>> + if (old->state == MODULE_STATE_COMING) { >>> + /* Wait in case it fails to

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

2012-09-17 Thread Rusty Russell
Lucas De Marchi writes: >> - 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_mute

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

2012-09-14 Thread Lucas De Marchi
Hi Rusty, On Fri, Sep 14, 2012 at 4:11 AM, Rusty Russell wrote: > The original module-init-tools module loader used a fnctl lock on the > .ko file to avoid attempts to simultaneously load a module. > Unfortunately, you can't get an exclusive fcntl lock on a read-only > fd, making this not work fo

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

2012-09-14 Thread Rusty Russell
The original module-init-tools module loader used a fnctl lock on the .ko file to avoid attempts to simultaneously load a module. Unfortunately, you can't get an exclusive fcntl lock on a read-only fd, making this not work for read-only mounted filesystems. module-init-tools has a hacky sleep-and-l