linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6: races between modprobe and depmod in rc.sysinit
@ 2003-07-31 17:45 Andrey Borzenkov
  2003-08-01  6:34 ` Rusty Russell
  0 siblings, 1 reply; 5+ messages in thread
From: Andrey Borzenkov @ 2003-07-31 17:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Chmouel Boudjnah, flepied, Rusty Russell

This started when I noticed that coldplugging of my USB flash did not work. I 
added call to /etc/hotplug/usb.rc in rc.sysinit but it still did not work 
because scsi.agent was not ready for 2.6. I fixed scsi.agent to work for 2.6 
- and it still did not work with nice message "sd_mod not found". I added 
strace to scsi.agent - and wow! it opens /lib/modules/`uname -r`/modules.dep 
and reads 0 bytes ... it adds /lib/modules/`uname -r`/modules.alias -and read 
0 bytes ...

the only reason I can imagine is that it hits depmod -A that runs in 
rc.sysinit and does

truncate /lib/modules/`uname -r`/modules.*
scan modules
write files

So, quesitons

- would anybody (Rusty?) object if I change depmod to do 
  build temp name
  move temp name into original

to avoid such races?

- Chmouel, Fred - is depmod on every boot really neccessary? When people 
install modules they are expected to run it actually ...

-andrey

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.6: races between modprobe and depmod in rc.sysinit
  2003-07-31 17:45 2.6: races between modprobe and depmod in rc.sysinit Andrey Borzenkov
@ 2003-08-01  6:34 ` Rusty Russell
  2003-08-01 21:22   ` [PATCH] " Andrey Borzenkov
  0 siblings, 1 reply; 5+ messages in thread
From: Rusty Russell @ 2003-08-01  6:34 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: linux-kernel, Chmouel Boudjnah, flepied

In message <200307312145.01711.arvidjaar@mail.ru> you write:
> the only reason I can imagine is that it hits depmod -A that runs in 
> rc.sysinit and does
> 
> truncate /lib/modules/`uname -r`/modules.*
> scan modules
> write files
> 
> So, quesitons
> 
> - would anybody (Rusty?) object if I change depmod to do 
>   build temp name
>   move temp name into original

No, that's definitely my preferred method anyway: please send patch.
Although I double this causes your problem here.

> - Chmouel, Fred - is depmod on every boot really neccessary? When people 
> install modules they are expected to run it actually ...

People get it wrong, and you still want them to boot.  Increasingly we
can live without depmod though: I might fix this in a near-future
version to live without it.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] 2.6: races between modprobe and depmod in rc.sysinit
  2003-08-01  6:34 ` Rusty Russell
@ 2003-08-01 21:22   ` Andrey Borzenkov
  2003-08-02  0:29     ` Rusty Russell
  0 siblings, 1 reply; 5+ messages in thread
From: Andrey Borzenkov @ 2003-08-01 21:22 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]

On Friday 01 August 2003 10:34, Rusty Russell wrote:
> In message <200307312145.01711.arvidjaar@mail.ru> you write:
> > the only reason I can imagine is that it hits depmod -A that runs in
> > rc.sysinit and does
> >
> > truncate /lib/modules/`uname -r`/modules.*
> > scan modules
> > write files
> >
> > So, quesitons
> >
> > - would anybody (Rusty?) object if I change depmod to do
> >   build temp name
> >   move temp name into original
>
> No, that's definitely my preferred method anyway: please send patch.
> Although I double this causes your problem here.
>

this does :) I have seen even more incredible races during boot recently. It 
affects other modules as well, like input loaded by hotplug triggered by USB 
load. depmod on current 2.6 takes some not negligible time.

anyway here is patch against 0.9.13-pre that makes depmod output in temp file 
and rename it after. It fixed the problem for sure for me (like commenting 
out depmod in rc.sysinit did but most people seem to object to it).

> > - Chmouel, Fred - is depmod on every boot really neccessary? When people
> > install modules they are expected to run it actually ...
>
> People get it wrong, and you still want them to boot.  Increasingly we
> can live without depmod though: I might fix this in a near-future
> version to live without it.
>

would be nice.

-andrey

[-- Attachment #2: module-init-tools-0.9.13-tempfile.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 1681 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 2.6: races between modprobe and depmod in rc.sysinit
  2003-08-01 21:22   ` [PATCH] " Andrey Borzenkov
@ 2003-08-02  0:29     ` Rusty Russell
  2003-08-08 21:19       ` Andrey Borzenkov
  0 siblings, 1 reply; 5+ messages in thread
From: Rusty Russell @ 2003-08-02  0:29 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: linux-kernel

In message <200308020122.55169.arvidjaar@mail.ru> you write:
> anyway here is patch against 0.9.13-pre that makes depmod output in temp file
> and rename it after. It fixed the problem for sure for me (like commenting 
> out depmod in rc.sysinit did but most people seem to object to it).

Thanks, I've applied this with a fix (you left the declaration of
skipchars in main(), so it shadowed the new global one).

I also repaired the testsuite after this patch (and found another bug
along the way), which also would have caught the mistake (Hint hint!).

I've put the lot up in the usual place, masquerading as 0.9.13-pre2.

	http://www.kernel.org/pub/linux/kernel/people/rusty/modules/module-init-tools-0.9.13-pre2.tar.gz

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 2.6: races between modprobe and depmod in rc.sysinit
  2003-08-02  0:29     ` Rusty Russell
@ 2003-08-08 21:19       ` Andrey Borzenkov
  0 siblings, 0 replies; 5+ messages in thread
From: Andrey Borzenkov @ 2003-08-08 21:19 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel

On Saturday 02 August 2003 04:29, Rusty Russell wrote:
> In message <200308020122.55169.arvidjaar@mail.ru> you write:
> > anyway here is patch against 0.9.13-pre that makes depmod output in temp
> > file and rename it after. It fixed the problem for sure for me (like
> > commenting out depmod in rc.sysinit did but most people seem to object to
> > it).
>
> Thanks, I've applied this with a fix (you left the declaration of
> skipchars in main(), so it shadowed the new global one).
>
> I also repaired the testsuite after this patch (and found another bug
> along the way), which also would have caught the mistake (Hint hint!).
>

thank you :)

> I've put the lot up in the usual place, masquerading as 0.9.13-pre2.
>
> 	http://www.kernel.org/pub/linux/kernel/people/rusty/modules/module-init-to
>ols-0.9.13-pre2.tar.gz
>
> Feedback welcome!

runs just fine. May I humbly ask for consistent naming scheme in future? 
Jumping from "pre" to "pre2" does not make packaging task easier :)

-andrey

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-08-08 22:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-31 17:45 2.6: races between modprobe and depmod in rc.sysinit Andrey Borzenkov
2003-08-01  6:34 ` Rusty Russell
2003-08-01 21:22   ` [PATCH] " Andrey Borzenkov
2003-08-02  0:29     ` Rusty Russell
2003-08-08 21:19       ` Andrey Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).