Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp170330lqh; Mon, 6 May 2024 15:18:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYvy/79xYDfbtHhw8RAhFgMO+aK0/FLVY2HG+RndQR8yZXNRuVPnb2mNeNY0jWer5TNfgoeXN7GYzlcq/wTBt2XXv16Hj+v7OIVbLmwQ== X-Google-Smtp-Source: AGHT+IGfWLIffOjhAs66k8rELsmnJDAfMeSqELChEZmcuWhp8upGAPUmc/mS/f6Oql0SlwdyhT3f X-Received: by 2002:a05:6359:4118:b0:18d:e328:7e7f with SMTP id kh24-20020a056359411800b0018de3287e7fmr14425379rwc.23.1715033931065; Mon, 06 May 2024 15:18:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715033931; cv=pass; d=google.com; s=arc-20160816; b=xJ+Oz6Q5QfhuwFLQwC9yOUjZxqGi9kLvgWIDqH7nXItR27u/oluvIw0fc/qhyzknqV egbXX7UP4XObswAwWcOX4nY6+34h5yHO6PmFP3vsKezC1grFhGAYNVoAYmSJpD262QOx lhbusbnjI3pYylEeg9vZF67SZ7R4rj8gvNI0EO24A/7yr7irSq8qYlVHflszWwA8OiR5 dgpCIJUHdxW06iiOLtvW9zdVKL0O6bWM5E9iYwhqPD6GCH7nvDfOh4Mi0JW3n0HT/YE/ 9HiTrWtobt1sEuXU6IVqCuHHOWgG5DBxnAiwLPIzIreH1RqHW5IyflT0eouIZSL08S6r jzqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=H4tAkfAI7C3BLA+cjtRULDa+t26iegxH3w/RcYzSWz8=; fh=GzUdTpSrwoGiZDmHn9tVqzaZkN8vFD447I7QR4YAXTQ=; b=pYsbzNjxQ5vBgFBEXlubZV7XvgEBNLGFTPYPmE7RXAkiYLZL5GF3XxNLMPKXx3/kc6 bjIB0POjO5wToKdocC6jntthuu/+7k5nd6qJcAeVu8429x2uRMmjm2zROZFvj9L/g5OX u/77ikzYgOLc9jLKKKXxoPikENWRaxtCCVpxOpJIhi6OnXc0Vs4RJvjiv5lfW2ax7Sl0 iLrKmhB60vH6RxjPgDAvhy+UJ1COWC7Xt4Lu5RlEfFyXHEbv6rZ6EeTm2mUibXuuv9yp y8hlGPJEMNFDwXeCLoxV4MAUJGoj5Wm2DIv4l0SgbZQMl2hp3Isp4JPSzt1gY1tLfnsR m3ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=KMZYMBF4; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-170467-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f34-20020a635562000000b00629b21ca25esi1411593pgm.433.2024.05.06.15.18.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 15:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170467-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=KMZYMBF4; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-170467-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id F0588B22C22 for ; Mon, 6 May 2024 22:11:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2F7D15CD6E; Mon, 6 May 2024 22:11:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="KMZYMBF4" Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDB6815CD49 for ; Mon, 6 May 2024 22:11:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715033492; cv=none; b=OXvUEaLwQjHKBhnUke8Udv3Vfk8tLwUNp0WHY4YOoN3oQeKN6fg86bqLQLNjNKLzB6bXnsrJqP0QJ1cuc4MShW3PRe8UDEPSt0lLX4sX0r1p/VLoGua029ey/5CA64J9L/0MSe+JyEY+fvA0BPeEQ03Nt2ZIC4+mIifrBPatUYc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715033492; c=relaxed/simple; bh=/Kkn3iylTA0/DbNE6xbIHvO5QRrH6fjFBRnumk+mQzc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LTJNQ2AcXaUZ2GjeTQAkhUZQA/NXdIDfgV2slV5Yml+YvBVLsJsFbNfi11y0AdwzI1yKiYS/9OiMob6Cfsz9KpjtSBIFLgT2g67+rT0ZI3TiI126U+1urIqEcaz9D9rnQ42WHCMMqMml0AzqU3wsvDGdAGmbEbiItdEkgMMVf5s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=KMZYMBF4; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715033488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H4tAkfAI7C3BLA+cjtRULDa+t26iegxH3w/RcYzSWz8=; b=KMZYMBF42BzUP1zS/OfDbRS16NS8PN4n4Ejkzvz3B5InLxteAeim8iUKXWTWxaoMMZZt0p P4qWm68KTzOCXSHHdB/MZzDM+rYzesepvl4LnjLtwFp7tJrpw/TopeEYt/eFefxHSHPNsl jEhoTE/yqa7QNPFv8nzeZihTkxTRjhg= Date: Mon, 6 May 2024 15:11:22 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v3] selftests/bpf: Move test_dev_cgroup to prog_tests Content-Language: en-GB To: Muhammad Usama Anjum , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20240401123455.1377896-1-usama.anjum@collabora.com> <92e1cce6-5f26-4a49-86b6-81e1e80d1aaa@linux.dev> <0ff5c7d0-d5c5-4b61-ba89-8e7f9f775935@linux.dev> <0973bc93-7a8d-451c-9944-d91a77d68755@collabora.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 5/3/24 6:55 AM, Muhammad Usama Anjum wrote: > On 4/5/24 1:06 AM, Yonghong Song wrote: >> On 4/3/24 5:03 AM, Muhammad Usama Anjum wrote: >>> On 4/3/24 7:36 AM, Yonghong Song wrote: >>>> On 4/2/24 8:16 AM, Muhammad Usama Anjum wrote: >>>>> Yonghong Song, >>>>> >>>>> Thank you so much for replying. I was missing how to run pipeline >>>>> manually. >>>>> Thanks a ton. >>>>> >>>>> On 4/1/24 11:53 PM, Yonghong Song wrote: >>>>>> On 4/1/24 5:34 AM, Muhammad Usama Anjum wrote: >>>>>>> Move test_dev_cgroup.c to prog_tests/dev_cgroup.c to be able to run it >>>>>>> with test_progs. Replace dev_cgroup.bpf.o with skel header file, >>>>>>> dev_cgroup.skel.h and load program from it accourdingly. >>>>>>> >>>>>>>      ./test_progs -t dev_cgroup >>>>>>>      mknod: /tmp/test_dev_cgroup_null: Operation not permitted >>>>>>>      64+0 records in >>>>>>>      64+0 records out >>>>>>>      32768 bytes (33 kB, 32 KiB) copied, 0.000856684 s, 38.2 MB/s >>>>>>>      dd: failed to open '/dev/full': Operation not permitted >>>>>>>      dd: failed to open '/dev/random': Operation not permitted >>>>>>>      #72     test_dev_cgroup:OK >>>>>>>      Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED >>>>>>> Signed-off-by: Muhammad Usama Anjum >>>>>>> --- >>>>>>> Changes since v2: >>>>>>> - Replace test_dev_cgroup with serial_test_dev_cgroup as there is >>>>>>>      probability that the test is racing against another cgroup test >>>>>>> - Minor changes to the commit message above >>>>>>> >>>>>>> I've tested the patch with vmtest.sh on bpf-next/for-next and linux >>>>>>> next. It is passing on both. Not sure why it was failed on BPFCI. >>>>>>> Test run with vmtest.h: >>>>>>> sudo LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh >>>>>>> ./test_progs -t dev_cgroup >>>>>>> ./test_progs -t dev_cgroup >>>>>>> mknod: /tmp/test_dev_cgroup_null: Operation not permitted >>>>>>> 64+0 records in >>>>>>> 64+0 records out >>>>>>> 32768 bytes (33 kB, 32 KiB) copied, 0.000403432 s, 81.2 MB/s >>>>>>> dd: failed to open '/dev/full': Operation not permitted >>>>>>> dd: failed to open '/dev/random': Operation not permitted >>>>>>>     #69      dev_cgroup:OK >>>>>>> Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED >>>>>> The CI failure: >>>>>> >>>>>> >>>>>> Error: #72 dev_cgroup >>>>>> serial_test_dev_cgroup:PASS:skel_open_and_load 0 nsec >>>>>> serial_test_dev_cgroup:PASS:cgroup_setup_and_join 0 nsec >>>>>> serial_test_dev_cgroup:PASS:bpf_attach 0 nsec >>>>>> serial_test_dev_cgroup:PASS:bpf_query 0 nsec >>>>>> serial_test_dev_cgroup:PASS:bpf_query 0 nsec >>>>>> serial_test_dev_cgroup:PASS:rm 0 nsec >>>>>> serial_test_dev_cgroup:PASS:mknod 0 nsec >>>>>> serial_test_dev_cgroup:PASS:rm 0 nsec >>>>>> serial_test_dev_cgroup:PASS:rm 0 nsec >>>>>> serial_test_dev_cgroup:FAIL:mknod unexpected mknod: actual 256 != >>>>>> expected 0 >>>>>> serial_test_dev_cgroup:PASS:rm 0 nsec >>>>>> serial_test_dev_cgroup:PASS:dd 0 nsec >>>>>> serial_test_dev_cgroup:PASS:dd 0 nsec >>>>>> serial_test_dev_cgroup:PASS:dd 0 nsec >>>>>> >>>>>> (cgroup_helpers.c:353: errno: Device or resource busy) umount cgroup2 >>>>>> >>>>>> The error code 256 means mknod execution has some issues. Maybe you >>>>>> need to >>>>>> find specific errno to find out what is going on. I think you can do ci >>>>>> on-demanding test to debug. >>>>> errno is 2 --> No such file or directory >>>>> >>>>> Locally I'm unable to reproduce it until I don't remove >>>>> rm -f /tmp/test_dev_cgroup_zero such that the /tmp/test_dev_cgroup_zero >>>>> node is present before test execution. The error code is 256 with errno 2. >>>>> I'm debugging by placing system("ls /tmp 1>&2"); to find out which files >>>>> are already present in /tmp. But ls's output doesn't appear on the CI >>>>> logs. >>>> errno 2 means ENOENT. >>>>  From mknod man page (https://linux.die.net/man/2/mknod), it means >>>>    A directory component in/pathname/  does not exist or is a dangling >>>> symbolic link. >>>> >>>> It means /tmp does not exist or a dangling symbolic link. >>>> It is indeed very strange. To make the test robust, maybe creating a temp >>>> directory with mkdtemp and use it as the path? The temp directory >>>> creation should be done before bpf prog attach. >>> I've tried following but still no luck: >>> * /tmp is already present. Then I thought maybe the desired file is already >>> present. I've verified that there isn't file of same name is present inside >>> /tmp. >>> * I thought maybe mknod isn't present in the system. But mknod --help >>> succeeds. >>> * I switched from /tmp to current directory to create the mknod. But the >>> result is same error. >>> * I've tried to use the same kernel config as the BPF CI is using. I'm not >>> able to reproduce it. >>> >>> Not sure which edge case or what's going on. The problem is appearing >>> because of some limitation in the rootfs. >> Maybe you could collect /tmp mount options to see whether anything is >> suspicious? In my vm, I have >>   tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=3501540k,nr_inodes=1048576) >> and the test works fine. >> >> > My test system: > tmpfs /tmp tmpfs rw,relatime 0 0 > > On the CI, /tmp is present. But it isn't tmpfs. Following shows the logs > from /proc/mounts > > On CI: > /dev/root / 9p > rw,relatime,cache=f,access=client,msize=512000,trans=virtio 0 0 > devtmpfs /dev devtmpfs > rw,relatime,size=1998612k,nr_inodes=499653,mode=755 0 0 > tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0 > proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 > tmpfs /run tmpfs rw,nosuid,nodev,relatime 0 0 > tmpfs /run/netns tmpfs rw,nosuid,nodev,relatime 0 0 > sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 > debugfs /sys/kernel/debug debugfs rw,relatime 0 0 > tracefs /sys/kernel/debug/tracing tracefs rw,relatime 0 0 > cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime 0 0 > tmpfs /sys/fs/cgroup tmpfs rw,relatime 0 0 somthing wrong here. /sys/fs/cgroup cannot be both cgroup2 and tmpfs types. > net_cls /sys/fs/cgroup/net_cls cgroup rw,relatime,net_cls 0 0 > tmpfs /sys/fs/cgroup tmpfs rw,relatime 0 0 > net_cls /sys/fs/cgroup/net_cls cgroup rw,relatime,net_cls 0 0 > tmpfs /sys/fs/cgroup tmpfs rw,relatime 0 0 > net_cls /sys/fs/cgroup/net_cls cgroup rw,relatime,net_cls 0 0 > bpffs /sys/fs/bpf bpf rw,relatime 0 0 > bpf /sys/fs/bpf bpf rw,relatime 0 0 > tmpfs /mnt tmpfs rw,nosuid,nodev,relatime 0 0 > vmtest-shared /mnt/vmtest 9p > rw,relatime,cache=f,access=client,msize=512000,trans=virtio 0 0 > none /mnt cgroup2 rw,relatime 0 0 >