2.6: races between modprobe and depmod in rc.sysinit

From: Andrey Borzenkov (arvidjaar_at_mail.ru)
Date: 07/31/03

  • Next message: Matthew Dharm: "Re: Zio! compactflash doesn't work"
    To: linux-kernel@vger.kernel.org
    Date:	Thu, 31 Jul 2003 21:45:01 +0400
    
    

    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Matthew Dharm: "Re: Zio! compactflash doesn't work"

    Relevant Pages

    • [PATCH] 2.6: races between modprobe and depmod in rc.sysinit
      ... >> move temp name into original ... this does:) I have seen even more incredible races during boot recently. ... depmod on current 2.6 takes some not negligible time. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6: races between modprobe and depmod in rc.sysinit
      ... > the only reason I can imagine is that it hits depmod -A that runs in ... > move temp name into original ... > install modules they are expected to run it actually ... ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.4.14-pre7 Unresolved symbols
      ... > trying to build 2.4.14-pre7 breaks with the error message ... This comes from `depmod` which is creating /lib/modules/`uname ... When you boot the new kernel, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] 2.6: races between modprobe and depmod in rc.sysinit
      ... >> commenting out depmod in rc.sysinit did but most people seem to object to ... which also would have caught the mistake (Hint hint!). ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • 2.6.6-rc3: gcc 2.95: cx88 __ucmpdi2 error
      ... > depmod says: ... the switch in set_tvaudio. ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)