From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasileios Almpanis Date: Mon, 17 Aug 2026 11:54:21 +0000 Subject: Re: [Devel] [PATCH VZ10 v5 9/9] selftests/ve: Add mount accounting selftest In-Reply-To: <74e7bed574901854c16d282bb96bff7bcf817f4f.1785669419.git.vladimir.riabchun@virtuozzo.com> References: <74e7bed574901854c16d282bb96bff7bcf817f4f.1785669419.git.vladimir.riabchun@virtuozzo.com> Message-ID: <178696766162.213331.8869287310500070657.b4-review@b4> List-Id: On Sun, 02 Aug 2026 11:40:39 +0000, Vladimir Riabchun 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 > +#include 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