From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 7425B8015A for ; Thu, 10 Sep 2026 03:11:36 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68A3AEbP023026; Thu, 10 Sep 2026 06:10:16 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68A3AEbP023026 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="nbQO6BVw" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68A3AC0Q023022 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 10 Sep 2026 06:10:12 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68A3AC0Q023022 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49cc954a3edso50968445e9.2 for ; Wed, 09 Sep 2026 20:10:12 -0700 (PDT) X-Gm-Message-State: AFuF++lKe9PCAq3nMsJmfdvvGTQBBAJy47htA1sJhu5V36nuE3y1wMgG qPyra3rcKBK2nLpTeVJ/npCw/wSkTihgUkp45Ysxm8spCsjN1TliYfhTmUow+V6thBg8LsmMg8m +aDqIr8tuv6GO/6wYuQbqtKxCjqH151NLk8ZPiFn6fu5Kb+kF+mRl0g== X-Gm-Gg: AYBFou2qzr9dOA+LCQShCOMNK9ASGNbQx8SHuZ5P7vTUyL8Khn54vlfr5ZwBLOUPcSX kPLO52bD1ZUSxJG5sfQJJ1f8mcMmVwWBkXAhqQGSJXAwgkdYiG/SemS1cySM7BO118PGfB8Y0qk ADg17wMIvUu6adz1pdtKKNvBhyp73s3xixk4Ds85ObiA0BV3Zj2DBfB6ihK8RfLgiUnZ0X0FSat e1Q8TWzlFicqMSRJzzdkABu1gfbSSmhHXxNDOW1lhEYMibWdJIV4w9H8Caq0mZrTLcKJCumKanA 5KVir3Y0phSjF169jcvOlEg6KAto1J9LeXxftATAVRdCVa4C7V23Uw444Y/C/oeZrZx3vYsucfk 17enQinQrjsuYV+I3ipFEcOBpgg== X-Received: by 2002:a05:600c:5247:b0:493:aa0a:45ad with SMTP id 5b1f17b1804b1-49cf81dadcamr353048795e9.2.1789009812516; Wed, 09 Sep 2026 20:10:12 -0700 (PDT) X-Received: by 2002:a05:600c:5247:b0:493:aa0a:45ad with SMTP id 5b1f17b1804b1-49cf81dadcamr353048515e9.2.1789009812019; Wed, 09 Sep 2026 20:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1789009812; cv=none; d=google.com; s=arc-20260327; b=Ob/UptHtoW94YveToEArOxiJ/i2+/EPgVj0RBnbkQ2juNyv++4HNXlHI+CYbr8vWeP J0Q0VyL4HcwcPupQn8LzAir9I23PWdWjuZ6FQg91mCgWF5VicMCgQm69j/eCTRu0d/cI VEPHJmTJAz9XVG5ZzXaVIqR6m0hVgtr8Ly4IbRPThA+V2jBjhcWhPbCbQPV83ujWy54c UyyBr1mIGnIYmDePEX0wXWkKzFzntjpQGOK/uKEQYM46BZKtv12kJptcujjg9cV494qO HwfQp2NWjFvBJgjcyJtu/J5A7FElc4ih0GNkyK3osK+26V23OOI3IOtRvDV5UVIGfL7m Wfcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=wswBttLSABV9zZT8IFtjfcS1TT8mYK3J6JPeyZZ4Phk=; fh=WpT6aB7RBAGHZeWZzqAr71yzRFbPTYkPWKsRagLn48Q=; b=cFdTLCy4sk93A/AqhZL+XISiZzKxwRcdmxZTnymXCIe1uM0XmroodG2lY3cAmSwrrR ZUNqpej7SLyDlok4nDFa52HmvFLLJQ7690Xd+1xSBm67URYamxkczgPHGrp9ZZe2/oCK RgAmHN5Tn48zBoHjSw+x6CSxu62W1iwkb8iiQA1a/ABqtglMt1uEQJV6j7HeIN6AsS7f ScrYWrcgkH/MjuQ0oN8awLyjedAdTPSn36JtHz1UUMskKzZPEkCiuEYck/vYN7LgDLIV Q0k3Vv6f8/3FZLZhdH0UqXEWG9oiazJ9l5h1vukebJJwTs7a7pTXnLcfDwGekklzio9k lblQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=nbQO6BVw; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-485881377desi38183693f8f.41.2026.09.09.20.10.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 20:10:11 -0700 (PDT) Received-SPF: pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=nbQO6BVw; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=wswBttLSABV9zZT8IFtjfcS1TT8mYK3J6JPeyZZ4Phk=; b=nbQO6BVwbrNl g+A/7z267IozSkPX6VgTRGcxu9FCozJL352L1ERd397E/kNW6XGHc8ujaM1NWDAkoqXBy05INnmq6 HXz0vaP/Du5UxTEBigkO/uKpxRiMTDLtkmfIvPXnZUXhfBcfYQDEDfpSAiflUn8dfTZtceL+nOxH4 Pv2dOqDeFFm+39A+orb/q2endbCjv48DwCPB5E8b75SSLk5G48FdtsTR7TlG3HTgFb9TJABhe8NXR IxezfSWR+5ZjkDnZwgHPR7WkKBTwy3uov7+71WRpa4dipTCkEi3+3u234ZpIn70lZT5ctlFyZnaOt sWgEo9WZfYv9y6Z1KujeFw==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=LekKit-T14) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x4V8M-002VeR-2e; Thu, 10 Sep 2026 05:10:09 +0200 From: Eva Kurchatova To: khorenko@virtuozzo.com Date: Thu, 10 Sep 2026 06:10:01 +0300 Message-ID: <20260910031003.395965-1-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH vz10 v2] selftests: binderfs: skip the stress test without binderfs X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org binderfs_stress mounts binderfs and asserts on the first mount, so on a kernel without CONFIG_ANDROID_BINDERFS the case fails rather than reporting that the filesystem is not there. Ask /proc/filesystems whether the kernel has it, the way supports_filesystem() in the landlock tests and check_resctrlfs_support() in the resctrl ones already do, and skip when it does not. Probing with a mount instead would not work here: the test is meant to run unprivileged, and path_mount() rejects an unprivileged caller in may_mount() before do_new_mount() ever looks the filesystem type up, so the probe would see EPERM whether binderfs is there or not. The child would then still reach the real mount inside its userns and fail. https://virtuozzo.atlassian.net/browse/VSTOR-142449 Feature: fix selftests Signed-off-by: Eva Kurchatova --- .../filesystems/binderfs/binderfs_test.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c index 319567f0fae1..fd1f9b6e5d46 100644 --- a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c +++ b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c @@ -36,6 +36,28 @@ fd = -EBADF; \ } +static bool binderfs_supported(void) +{ + char line[128]; + bool ret = false; + FILE *f; + + f = fopen("/proc/filesystems", "r"); + if (!f) + return true; /* Cannot tell, let the test run and report. */ + + while (fgets(line, sizeof(line), f)) { + /* binderfs has no backing device, hence the "nodev" prefix. */ + if (!strcmp(line, "nodev\tbinder\n")) { + ret = true; + break; + } + } + + fclose(f); + return ret; +} + static void change_mountns(struct __test_metadata *_metadata) { int ret; @@ -388,6 +410,9 @@ TEST(binderfs_stress) char binderfs_mntpt[] = P_tmpdir "/binderfs_XXXXXX", device_path[sizeof(P_tmpdir "/binderfs_XXXXXX/") + BINDERFS_MAX_NAME]; + if (!binderfs_supported()) + SKIP(return, "The Android binderfs filesystem is not available"); + ret = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, syncfds); ASSERT_EQ(ret, 0) { TH_LOG("%s - Failed to create socket pair", strerror(errno)); -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel