From patchwork Tue Jul 27 05:59:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Liang X-Patchwork-Id: 1510314 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GYmNB2Vq3z9sRK for ; Tue, 27 Jul 2021 15:59:54 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 488C13C6598 for ; Tue, 27 Jul 2021 07:59:52 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 576AA3C57B2 for ; Tue, 27 Jul 2021 07:59:50 +0200 (CEST) Received: from ATCSQR.andestech.com (atcsqr.andestech.com [60.248.187.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 391D71A00E09 for ; Tue, 27 Jul 2021 07:59:47 +0200 (CEST) Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 16R5xGWX008254; Tue, 27 Jul 2021 13:59:16 +0800 (GMT-8) (envelope-from ycliang@andestech.com) Received: from atcfdc88 (10.0.15.120) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Tue, 27 Jul 2021 13:59:17 +0800 Date: Tue, 27 Jul 2021 13:59:14 +0800 From: Leo Liang To: Message-ID: <20210727055859.GA16380@atcfdc88> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.0.15.120] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 16R5xGWX008254 X-Virus-Scanned: clamav-milter 0.102.4 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH v5, 1/2] lib/tst_test.sh: Make tst_umount work with argument has trailing slash X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richiejp@f-m.fm, ycliang@cs.nctu.edu.tw, alankao@andestech.com, metan@ucw.cz Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" /proc/mounts shows the mount point without trailing slashes, e.g. ~ $ cat /proc/mounts xxx /root/cgroup cgroup rw,relatime,cpu 0 0 So current tst_umount would not work with argument that has trailing slash, e.g. tst_umount cgroup/ would give "The device is not mounted". Fix this by filtering out the trailing slash in the argument for grep. Signed-off-by: Leo Yu-Chi Liang Reviewed-by: Petr Vorel --- testcases/lib/tst_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index c6aa2c487..cbdfb707a 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -282,7 +282,7 @@ tst_umount() [ -z "$device" ] && return - if ! grep -q "$device" /proc/mounts; then + if ! grep -q "${device%/}" /proc/mounts; then tst_res TINFO "The $device is not mounted, skipping umount" return fi From patchwork Tue Jul 27 06:00:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Liang X-Patchwork-Id: 1510315 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GYmPs3yx6z9sRK for ; Tue, 27 Jul 2021 16:01:20 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id BF8393C6566 for ; Tue, 27 Jul 2021 08:01:18 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id D49853C1C82 for ; Tue, 27 Jul 2021 08:01:14 +0200 (CEST) Received: from ATCSQR.andestech.com (exmail.andestech.com [60.248.187.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 0C7541000D07 for ; Tue, 27 Jul 2021 08:01:13 +0200 (CEST) Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 16R60mJb009343; Tue, 27 Jul 2021 14:00:48 +0800 (GMT-8) (envelope-from ycliang@andestech.com) Received: from atcfdc88 (10.0.15.120) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Tue, 27 Jul 2021 14:00:46 +0800 Date: Tue, 27 Jul 2021 14:00:44 +0800 From: Leo Liang To: Message-ID: <20210727060029.GA16474@atcfdc88> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.0.15.120] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 16R60mJb009343 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH v5, 2/2] cgroup/cgroup_regression_test: Fix umount failure X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richiejp@f-m.fm, ycliang@cs.nctu.edu.tw, alankao@andestech.com, metan@ucw.cz Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The test sequence mount -t cgroup -o mkdir / rmdir / umount mount -t cgroup -o would easily fail at the last mount with -EBUSY on certain platform. The reason is that this test sequence would have the chance of missing a release code path when doing rmdir and umount. Adding a little delay between "rmdir" and "umount" could fix the problem, so use tst_umount API instead of umount in "rmdir, umount" sequence. Fixes: #839 Signed-off-by: Leo Yu-Chi Liang --- .../controllers/cgroup/cgroup_regression_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh index 1f7f3820e..bc4dbe151 100755 --- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh @@ -145,7 +145,7 @@ test2() fi rmdir cgroup/0 cgroup/1 - umount cgroup/ + tst_umount cgroup/ # Avoid possible EBUSY error } #--------------------------------------------------------------------------- @@ -193,7 +193,7 @@ test3() wait $pid2 2>/dev/null rmdir $cpu_subsys_path/0 2> /dev/null - umount cgroup/ 2> /dev/null + tst_umount cgroup/ # Avoid possible EBUSY error check_kernel_bug } @@ -222,7 +222,7 @@ test4() mount -t cgroup -o none,name=foo cgroup cgroup/ mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ + tst_umount cgroup/ # Avoid possible EBUSY error if dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"; then tst_res TFAIL "lockdep BUG was found" @@ -254,7 +254,7 @@ test5() mount -t cgroup none cgroup 2> /dev/null mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ 2> /dev/null + tst_umount cgroup/ # Avoid possible EBUSY error check_kernel_bug } @@ -290,7 +290,7 @@ test6() mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1 rmdir cgroup/[1-9]* > /dev/null 2>&1 - umount cgroup/ + tst_umount cgroup/ # Avoid possible EBUSY error check_kernel_bug }