Skip to contentSkip to conversation

bpf: cgroup: annotate pointers in struct cgroup_bpf with __rcu

PATCH Applied Daniel Mack 3 participants 3 messages Dec 15, 2016 – Dec 17, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: cgroup: annotate pointers in struct cgroup_bpf with __rcu

The member 'effective' in 'struct cgroup_bpf' is protected by RCU. Annotate it accordingly to squelch a sparse warning.

---
 include/linux/bpf-cgroup.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/bpf-cgroup.h +1 -1
index 7b6e5d1..92bc89a 100644
@@ -20,7 +20,7 @@ struct cgroup_bpf {
 	 * when this cgroup is accessed.
 	 */
 	struct bpf_prog *prog[MAX_BPF_ATTACH_TYPE];
-	struct bpf_prog *effective[MAX_BPF_ATTACH_TYPE];
+	struct bpf_prog __rcu *effective[MAX_BPF_ATTACH_TYPE];
 };
 
 void cgroup_bpf_put(struct cgroup *cgrp);
Signature · 1 line
2.9.3
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Daniel Mack

The member 'effective' in 'struct cgroup_bpf' is protected by RCU. Annotate it accordingly to squelch a sparse warning.

was only wondering whether this is really needed for net or can wait till net-next.

Quoted 20 lines
---
 include/linux/bpf-cgroup.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/bpf-cgroup.h +1 -1
index 7b6e5d1..92bc89a 100644
@@ -20,7 +20,7 @@ struct cgroup_bpf {
 	 * when this cgroup is accessed.
 	 */
 	struct bpf_prog *prog[MAX_BPF_ATTACH_TYPE];
-	struct bpf_prog *effective[MAX_BPF_ATTACH_TYPE];
+	struct bpf_prog __rcu *effective[MAX_BPF_ATTACH_TYPE];
 };
 
 void cgroup_bpf_put(struct cgroup *cgrp);
Signature · 1 line
2.9.3