1 Star 0 Fork 44

firstadream/lxc

forked from src-openEuler/lxc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0032-fix-load-bpf-failed.patch 913 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhangxiaoyu 提交于 2023-05-06 16:49 . fix load bpf failed
From ea611fd8e2c04e65c9239a9236376b2686b16832 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <[email protected]>
Date: Sat, 6 May 2023 17:25:41 +0800
Subject: [PATCH] fix load bpf failed
Signed-off-by: zhangxiaoyu <[email protected]>
---
src/lxc/cgroups/cgroup2_devices.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/lxc/cgroups/cgroup2_devices.c b/src/lxc/cgroups/cgroup2_devices.c
index 04ba7b3..690e0b3 100644
--- a/src/lxc/cgroups/cgroup2_devices.c
+++ b/src/lxc/cgroups/cgroup2_devices.c
@@ -237,6 +237,12 @@ int bpf_program_append_device(struct bpf_program *prog, struct device_item *devi
if (device->minor != -1)
jump_nr++;
+#ifdef HAVE_ISULAD
+ // add a check, if no jump should do, just return.
+ if (jump_nr == 1)
+ return 0;
+#endif
+
if (device_type > 0) {
struct bpf_insn ins[] = {
BPF_JMP_IMM(BPF_JNE, BPF_REG_2, device_type, jump_nr--),
--
2.25.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/firstadream/lxc.git
[email protected]:firstadream/lxc.git
firstadream
lxc
lxc
master

搜索帮助