Skip to content

Commit c0002d1

Browse files
ArthurChiaohtejun
authored andcommitted
cgroupv2, docs: fix misinformation in "device controller" section
Hotmail was rejected by the mailing list, switched to gmail to resend. 1. Clarify cgroup BPF program type and attach type; 2. Fix file path broken. Signed-off-by: ArthurChiao <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent b94f9ac commit c0002d1

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Documentation/admin-guide/cgroup-v2.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,19 +2170,19 @@ existing device files.
21702170

21712171
Cgroup v2 device controller has no interface files and is implemented
21722172
on top of cgroup BPF. To control access to device files, a user may
2173-
create bpf programs of the BPF_CGROUP_DEVICE type and attach them
2174-
to cgroups. On an attempt to access a device file, corresponding
2175-
BPF programs will be executed, and depending on the return value
2176-
the attempt will succeed or fail with -EPERM.
2177-
2178-
A BPF_CGROUP_DEVICE program takes a pointer to the bpf_cgroup_dev_ctx
2179-
structure, which describes the device access attempt: access type
2180-
(mknod/read/write) and device (type, major and minor numbers).
2181-
If the program returns 0, the attempt fails with -EPERM, otherwise
2182-
it succeeds.
2183-
2184-
An example of BPF_CGROUP_DEVICE program may be found in the kernel
2185-
source tree in the tools/testing/selftests/bpf/progs/dev_cgroup.c file.
2173+
create bpf programs of type BPF_PROG_TYPE_CGROUP_DEVICE and attach
2174+
them to cgroups with BPF_CGROUP_DEVICE flag. On an attempt to access a
2175+
device file, corresponding BPF programs will be executed, and depending
2176+
on the return value the attempt will succeed or fail with -EPERM.
2177+
2178+
A BPF_PROG_TYPE_CGROUP_DEVICE program takes a pointer to the
2179+
bpf_cgroup_dev_ctx structure, which describes the device access attempt:
2180+
access type (mknod/read/write) and device (type, major and minor numbers).
2181+
If the program returns 0, the attempt fails with -EPERM, otherwise it
2182+
succeeds.
2183+
2184+
An example of BPF_PROG_TYPE_CGROUP_DEVICE program may be found in
2185+
tools/testing/selftests/bpf/progs/dev_cgroup.c in the kernel source tree.
21862186

21872187

21882188
RDMA

0 commit comments

Comments
 (0)