OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Subject: Re: [Devel] [PATCH VZ10 v5 9/9] selftests/ve: Add mount accounting selftest
Date: Mon, 17 Aug 2026 11:54:21 +0000	[thread overview]
Message-ID: <178696766162.213331.8869287310500070657.b4-review@b4> (raw)
In-Reply-To: <74e7bed574901854c16d282bb96bff7bcf817f4f.1785669419.git.vladimir.riabchun@virtuozzo.com>

On Sun, 02 Aug 2026 11:40:39 +0000, Vladimir Riabchun <vladimir.riabchun@virtuozzo.com> wrote:
> There are 6 test cases, covered in the new test:
> 1. Simple mount accouting correctness, just mount/umount.
> 2. Verification of correct limit hits and changes, including
>    negative values.
> 3. Patial mounts test, when mount limit is hit in the middle
>    of creation.

nit: Partial

> 4. Test that enabled pseudosuper allows overuse.
> 5. Test that pseudosuper doesn't affect mount accoutning.

nit: accounting

>
>
> diff --git a/tools/testing/selftests/ve/ve_mount_accounting_test.c b/tools/testing/selftests/ve/ve_mount_accounting_test.c
> new file mode 100644
> index 000000000000..b295290ec6e8
> --- /dev/null
> +++ b/tools/testing/selftests/ve/ve_mount_accounting_test.c
> @@ -0,0 +1,419 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * ve_mount_accounting selftests
> + *
> + * Tests to check the correctness of mount accounting.
> + */
> +#define _GNU_SOURCE
> +#include <linux/sched.h>
> +#include <linux/mount.h>

Is linux/mount needed here? You include both linux/mount and sys/mount.
You only call mount,umount so dropping it looks generally safe.

> [ ... skip 181 lines ... ]
> +	ASSERT_EQ(read_u64_at(self->cgv2_fd, path, &initial_mnt_avail_nr), 0);
> +	ASSERT_EQ(initial_mnt_avail_nr, VE_MOUNTS_MAX);
> +};
> +
> +FIXTURE_TEARDOWN(ve_mnt_acc)
> +{

Since we mount tmpfs on host mount namespace (we dont pass CLONE_NEWNS), 
should we iterate here and umount all the ids that remain mounted after 
tests bail? There are maybe places where create_mount is tried and if 
assertion fails the mount remains and leaks to the host possibly also 
pinning the ve namespace since in ve_try_reserve_mount we get a refcount 
on it.

-- 
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>

  parent reply	other threads:[~2026-08-17 11:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02 11:40 [Devel] [PATCH VZ10 v5 0/9] Add per-VE failcount support Vladimir Riabchun
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 1/9] ve/ve.{h, c}: Farewell to spaces as indents Vladimir Riabchun
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 2/9] ve/namespace: Fix UAF in alloc_mnt_ns Vladimir Riabchun
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 3/9] ve/fs: Rework per-ve mount count Vladimir Riabchun
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 4/9] selftests/ve: Update ve_ns_owner_test Vladimir Riabchun
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 5/9] ve: Move from global VE mounts limit to per-VE limit Vladimir Riabchun
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 6/9] ve/ve.c: Generate VE resource accessors using macros Vladimir Riabchun
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 7/9] ve: Introduce per-VE failcount Vladimir Riabchun
2026-08-07  9:25   ` Vasileios Almpanis
2026-08-17 11:54   ` Vasileios Almpanis
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 8/9] selftests/ve: Add more helpers Vladimir Riabchun
2026-08-02 11:40 ` [Devel] [PATCH VZ10 v5 9/9] selftests/ve: Add mount accounting selftest Vladimir Riabchun
2026-08-07 10:01   ` Vasileios Almpanis
2026-08-17 11:54   ` Vasileios Almpanis [this message]
2026-08-17 11:54 ` [Devel] [PATCH VZ10 v5 0/9] Add per-VE failcount support Vasileios Almpanis
2026-08-17 14:09   ` Vasileios Almpanis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178696766162.213331.8869287310500070657.b4-review@b4 \
    --to=vasileios.almpanis@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox