Skip to contentSkip to conversation

bpf/local_storage: Fix build without CONFIG_CGROUP

PATCH Applied YiFei Zhu 2 participants 2 messages Jul 24, 2020 – Jul 25, 2020 BPF

lore
Share & tools
lore

YiFei Zhu

author
#0 lore raw

PATCH 1/1 bpf/local_storage: Fix build without CONFIG_CGROUP

From: YiFei Zhu <[email protected]>

local_storage.o has its compile guard as CONFIG_BPF_SYSCALL, which does not imply that CONFIG_CGROUP is on. Including cgroup-internal.h when CONFIG_CGROUP is off cause a compilation failure.

Fixes f67cfc233706 ("bpf: Make cgroup storages shared between programs on the same cgroup")
---
 kernel/bpf/local_storage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/bpf/local_storage.c +2 -2
index 3b2c70197d78..571bb351ed3b 100644
@@ -9,12 +9,12 @@
 #include <linux/slab.h>
 #include <uapi/linux/btf.h>
 
-#include "../cgroup/cgroup-internal.h"
-
 DEFINE_PER_CPU(struct bpf_cgroup_storage*, bpf_cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE]);
 
 #ifdef CONFIG_CGROUP_BPF
 
+#include "../cgroup/cgroup-internal.h"
+
 #define LOCAL_STORAGE_CREATE_FLAG_MASK					\
 	(BPF_F_NUMA_NODE | BPF_F_ACCESS_MASK)
 
Signature · 1 line
2.27.0
#1 lore raw
Quoted 10 lines · YiFei Zhu

From: YiFei Zhu <[email protected]>

local_storage.o has its compile guard as CONFIG_BPF_SYSCALL, which does not imply that CONFIG_CGROUP is on. Including cgroup-internal.h when CONFIG_CGROUP is off cause a compilation failure.

Fixes f67cfc233706 ("bpf: Make cgroup storages shared between programs on the same cgroup")

Applied. Thanks