[v2,0/3] Fix dependency file corruption with parallel depmod invocation
mbox series

Message ID cover.1544476531.git.msuchanek@suse.de
Headers show
Series
  • Fix dependency file corruption with parallel depmod invocation
Related show

Message

Michal Suchanek Dec. 10, 2018, 9:29 p.m. UTC
The files produced by depmod may be corrupted if multiple depmod processes
running in parallel try to update them. Since there is nothing stopping the
user running depmod in parallel this looks like a bug in depmod.

When a package manager is used it synchronizes adding or removeing module files
and depmod invocation. However, user might use other script that is not
synchronized with package manager or invoke depmod by hand.

When global synchronizarion is missing we cannot guarantee completely
consistent state because adding and removing module files is anynchronous.
However, we should guarantee the system is bootable if the user did not remove
the modules needed for boot. For that the dependency file should not get
removed or corrupted.

Thanks

Michal

Michal Suchanek (3):
  depmod: prevent module dependency files missing during depmod
    invocation.
  depmod: prevent module dependency files corruption due to parallel
    invocation.
  depmod: shut up gcc insufficinet buffer warning.

 tools/depmod.c | 64 ++++++++++++++++++++++++++++++++++----------------
 1 file changed, 44 insertions(+), 20 deletions(-)