Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH bpf] selftests/bpf: don't hard-code root cgroup id
@ 2019-12-02 20:01 Stanislav Fomichev
  2019-12-05  1:57 ` Alexei Starovoitov
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Fomichev @ 2019-12-02 20:01 UTC (permalink / raw)
  To: netdev, bpf; +Cc: davem, ast, daniel, Stanislav Fomichev

Commit 40430452fd5d ("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: 40430452fd5d ("kernfs: use 64bit inos if ino_t is 64bit")
Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
 tools/testing/selftests/bpf/test_skb_cgroup_id_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/test_skb_cgroup_id_user.c b/tools/testing/selftests/bpf/test_skb_cgroup_id_user.c
index 9220747c069d..356351c0ac28 100644
--- a/tools/testing/selftests/bpf/test_skb_cgroup_id_user.c
+++ b/tools/testing/selftests/bpf/test_skb_cgroup_id_user.c
@@ -120,7 +120,7 @@ int check_ancestor_cgroup_ids(int prog_id)
 	int err = 0;
 	int map_fd;
 
-	expected_ids[0] = 0x100000001;	/* root cgroup */
+	expected_ids[0] = get_cgroup_id("/..");	/* root cgroup */
 	expected_ids[1] = get_cgroup_id("");
 	expected_ids[2] = get_cgroup_id(CGROUP_PATH);
 	expected_ids[3] = 0; /* non-existent cgroup */
-- 
2.24.0.393.g34dc348eaf-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH bpf] selftests/bpf: don't hard-code root cgroup id
  2019-12-02 20:01 [PATCH bpf] selftests/bpf: don't hard-code root cgroup id Stanislav Fomichev
@ 2019-12-05  1:57 ` Alexei Starovoitov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexei Starovoitov @ 2019-12-05  1:57 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: Network Development, bpf, David S. Miller, Alexei Starovoitov,
	Daniel Borkmann

On Mon, Dec 2, 2019 at 12:01 PM Stanislav Fomichev <sdf@google.com> wrote:
>
> Commit 40430452fd5d ("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: 40430452fd5d ("kernfs: use 64bit inos if ino_t is 64bit")
> Signed-off-by: Stanislav Fomichev <sdf@google.com>

Applied. Thanks for the fix!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02 20:01 [PATCH bpf] selftests/bpf: don't hard-code root cgroup id Stanislav Fomichev
2019-12-05  1:57 ` Alexei Starovoitov

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git