34 lines
1.1 KiB
Diff
34 lines
1.1 KiB
Diff
|
From 3a48513ff3b5ab0b19696bc4c0fabb351bd62afb Mon Sep 17 00:00:00 2001
|
||
|
From: Michal Suchanek <msuchanek@suse.de>
|
||
|
Date: Mon, 10 Dec 2018 15:30:07 +0100
|
||
|
Subject: [PATCH] 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 newa file in place and remove unlink the old one. It
|
||
|
should also do both atomically so there is no window whn no dependency
|
||
|
file exists.
|
||
|
|
||
|
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
|
||
|
---
|
||
|
tools/depmod.c | 1 -
|
||
|
1 file changed, 1 deletion(-)
|
||
|
|
||
|
diff --git a/tools/depmod.c b/tools/depmod.c
|
||
|
index 989d9077926c..18c0d61b2db3 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",
|
||
|
--
|
||
|
2.19.2
|
||
|
|