summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-12-10 22:29:32 +0100
committerLucas De Marchi <lucas.demarchi@intel.com>2018-12-17 10:19:50 -0800
commitc2996b5fa880e81f63c25e80a4157b2239e32c5d (patch)
tree44cdc3947cf9a5ae7a82b10de8ad70305dd7f742
parent028d4df365484206cf8baadad905870bbc079c5e (diff)
downloadkmod-c2996b5fa880e81f63c25e80a4157b2239e32c5d.tar.gz
kmod-c2996b5fa880e81f63c25e80a4157b2239e32c5d.tar.bz2
kmod-c2996b5fa880e81f63c25e80a4157b2239e32c5d.zip
depmod: prevent module dependency files missing during depmod invocation
depmod deletes the module dependency files before moving the temporary files in their place. This results in user seeing no dependency files while they are updated. Remove the unlink call. The rename call should suffice to move the new file in place and unlink the old one. It should also do both atomically so there is no window when no dependency file exists. Signed-off-by: Michal Suchanek <msuchanek@suse.de>
-rw-r--r--tools/depmod.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/tools/depmod.c b/tools/depmod.c
index 989d907..18c0d61 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -2451,7 +2451,6 @@ static int depmod_output(struct depmod *depmod, FILE *out)
break;
}
- unlinkat(dfd, itr->name, 0);
if (renameat(dfd, tmp, dfd, itr->name) != 0) {
err = -errno;
CRIT("renameat(%s, %s, %s, %s): %m\n",