Skip to content

Commit 01d434c

Browse files
fomichevAlexei Starovoitov
authored andcommitted
selftests/bpf: Don't hard-code root cgroup id
Commit 4043045 ("kernfs: use 64bit inos if ino_t is 64bit") changed the way cgroup ids are exposed to the userspace. Instead of assuming fixed root id, let's query it. Fixes: 4043045 ("kernfs: use 64bit inos if ino_t is 64bit") Signed-off-by: Stanislav Fomichev <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent edbca12 commit 01d434c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/test_skb_cgroup_id_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int check_ancestor_cgroup_ids(int prog_id)
120120
int err = 0;
121121
int map_fd;
122122

123-
expected_ids[0] = 0x100000001; /* root cgroup */
123+
expected_ids[0] = get_cgroup_id("/.."); /* root cgroup */
124124
expected_ids[1] = get_cgroup_id("");
125125
expected_ids[2] = get_cgroup_id(CGROUP_PATH);
126126
expected_ids[3] = 0; /* non-existent cgroup */

0 commit comments

Comments
 (0)