kmod: revert "depmod: Do not unlinkat orig depfile and add fync"

this patch can be replaced by an open source patch:
https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=c2996b5fa880e81f63c25e80a4157b2239e32c5d

Signed-off-by: Jiangfeng Xiao <xiaojiangfeng@huawei.com>
This commit is contained in:
Jiangfeng Xiao 2021-12-09 21:36:05 +08:00
parent ecc98e321b
commit cc888c7736
5 changed files with 7 additions and 42 deletions

View File

@ -1,37 +0,0 @@
From 0f3d89015caf91ea96359ba7e2afd2aa8ab67e85 Mon Sep 17 00:00:00 2001
From: guoxiaoqi <guoxiaoqi2@huawei.com>
Date: Fri, 25 Jan 2019 17:03:05 +0000
Subject: [PATCH] ok
Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com>
---
tools/depmod.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/depmod.c b/tools/depmod.c
index fbbce10..01db7ad 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -2529,6 +2529,7 @@ static int depmod_output(struct depmod *depmod, FILE *out)
if (fp == out)
continue;
+ fsync(fileno(fp));
ferr = ferror(fp) | fclose(fp);
if (r < 0) {
@@ -2556,8 +2557,10 @@ static int depmod_output(struct depmod *depmod, FILE *out)
}
}
- if (dfd >= 0)
+ if (dfd >= 0) {
+ fsync(dfd);
close(dfd);
+ }
return err;
}
--
2.19.1

View File

@ -1,6 +1,6 @@
Name: kmod Name: kmod
Version: 29 Version: 29
Release: 1 Release: 2
Summary: Kernel module management Summary: Kernel module management
# GPLv2+ is used by programs, LGPLv2+ is used for libraries. # GPLv2+ is used by programs, LGPLv2+ is used for libraries.
License: GPLv2+ and LGPLv2+ License: GPLv2+ and LGPLv2+
@ -10,10 +10,9 @@ Source1: weak-modules
Source2: depmod.conf.dist Source2: depmod.conf.dist
Patch1: 0001-libkmod-module-check-new_from_name-return-value-in-g.patch Patch1: 0001-libkmod-module-check-new_from_name-return-value-in-g.patch
Patch2: 0002-kmod-20-8-depmod-Don-t-unlinkat-orig-depfile-and-add-fsync.patch Patch2: 0002-Module-replace-the-module-with-new-module.patch
Patch3: 0003-Module-replace-the-module-with-new-module.patch Patch3: 0003-Module-suspend-the-module-by-rmmod-r-option.patch
Patch4: 0004-Module-suspend-the-module-by-rmmod-r-option.patch Patch4: 0004-don-t-check-module-s-refcnt-when-rmmod-with-r.patch
Patch5: 0005-don-t-check-module-s-refcnt-when-rmmod-with-r.patch
BuildRequires: gcc chrpath zlib-devel xz-devel libxslt openssl-devel BuildRequires: gcc chrpath zlib-devel xz-devel libxslt openssl-devel
@ -108,6 +107,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf
%doc TODO NEWS README %doc TODO NEWS README
%changelog %changelog
* Thu Dec 9 2021 Jiangfeng Xiao <xiaojiangfeng@huawei.com> - 29-2
- kmod: revert "depmod: Do not unlinkat orig depfile and add fync"
* Fri Dec 3 2021 zhouwenpei <zhouwenpei1@huawei.com> - 29-1 * Fri Dec 3 2021 zhouwenpei <zhouwenpei1@huawei.com> - 29-1
- update kmod to 29 - update kmod to 29