1 Star 0 Fork 28

openeuler-robot/kmod

forked from src-openEuler/kmod 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-don-t-check-module-s-refcnt-when-rmmod-with-r.patch 972 Bytes
一键复制 编辑 原始数据 按行查看 历史
From e48b7f950e8a6c8b6ba825a14a5aeb8a5064cdfc Mon Sep 17 00:00:00 2001
From: Liu Chao <liuchao173@huawei.com>
Date: Mon, 7 Jun 2021 06:46:49 +0000
Subject: [PATCH] kmod: don't check module's refcnt when rmmod with -r
When we remove module that only kernel livepatches depend on it by
remmod -r, we want to only invoke resume function. But kmod will check
refcnt first, if refcnt is more than zero, kmod won't call kernel's
delete_module.
Signed-off-by: Liu Chao <liuchao173@huawei.com>
---
tools/rmmod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/rmmod.c b/tools/rmmod.c
index 1278234..1d8d20b 100644
--- a/tools/rmmod.c
+++ b/tools/rmmod.c
@@ -178,7 +178,7 @@ static int do_rmmod(int argc, char *argv[])
break;
}
- if (!(flags & KMOD_REMOVE_FORCE) && check_module_inuse(mod) < 0) {
+ if (!(flags & KMOD_REMOVE_FORCE) && !(flags & KMOD_REMOVE_REPLACE) && check_module_inuse(mod) < 0) {
r++;
goto next;
}
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yang_yanchao/kmod.git
git@gitee.com:yang_yanchao/kmod.git
yang_yanchao
kmod
kmod
master

搜索帮助