Skip to content

Commit 35256d6

Browse files
yosrym93htejun
authored andcommitted
bpf: cgroup_iter: support cgroup1 using cgroup fd
Use cgroup_v1v2_get_from_fd() in cgroup_iter to support attaching to both cgroup v1 and v2 using fds. Signed-off-by: Yosry Ahmed <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent a6d1ce5 commit 35256d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/cgroup_iter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int bpf_iter_attach_cgroup(struct bpf_prog *prog,
196196
return -EINVAL;
197197

198198
if (fd)
199-
cgrp = cgroup_get_from_fd(fd);
199+
cgrp = cgroup_v1v2_get_from_fd(fd);
200200
else if (id)
201201
cgrp = cgroup_get_from_id(id);
202202
else /* walk the entire hierarchy by default. */

0 commit comments

Comments
 (0)