From: Dave Chinner <david@fromorbit.com>
To: Zorro Lang <zlang@kernel.org>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH v2 1/2] check: disable HAVE_PRIVATENS by default
Date: Thu, 6 Mar 2025 22:05:13 +1100 [thread overview]
Message-ID: <Z8mBacJNAj6gVd7N@dread.disaster.area> (raw)
In-Reply-To: <20250306094924.1353269-2-zlang@kernel.org>
On Thu, Mar 06, 2025 at 05:49:23PM +0800, Zorro Lang wrote:
> Currently we have 3 ways to run a test case in _run_seq():
>
> if [ -n "${HAVE_PRIVATENS}" ]; then
> ./tools/run_privatens "./$seq"
> ...
> elif [ -n "${HAVE_SYSTEMD_SCOPES}" ]; then
> systemd-run --quiet --unit "${unit}" --scope \
> ./tools/run_setsid "./$seq" &
> ...
> else
> ./tools/run_setsid "./$seq" &
> ...
> fi
>
> The "privatens" way brings in some regressions. We need more time
> to develop and test this way, it's not time let it to be the
> first default choice, so isolate the HAVE_PRIVATENS initialization
> by a TRY_PRIVATENS parameter, and disable it by default.
>
> Set TRY_PRIVATENS=yes to give "privatens" a try, otherwise run in
> old ways. This patch can be removed after "privatens" way is stable.
>
> Signed-off-by: Zorro Lang <zlang@kernel.org>
> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
> ---
> check | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/check b/check
> index ea92b0d62..cb2f19d08 100755
> --- a/check
> +++ b/check
> @@ -674,10 +674,13 @@ _stash_test_status() {
> esac
> }
>
> -# Can we run in a private pid/mount namespace?
> -HAVE_PRIVATENS=
> -./tools/run_privatens bash -c "exit 77"
> -test $? -eq 77 && HAVE_PRIVATENS=yes
> +# Don't try "privatens" by default, it's experimental for now.
> +if [ "$TRY_PRIVATENS" = "yes" ];then
> + # Can we run in a private pid/mount namespace?
> + HAVE_PRIVATENS=
> + ./tools/run_privatens bash -c "exit 77"
> + test $? -eq 77 && HAVE_PRIVATENS=yes
> +fi
Works for me - I have basically the same patch in my check-parallel
stack because this breaks check-parallel mount namespacing for
reasons I don't yet understand.
Creating a new mount namespace for each test that is run appears
to turn the private mount namespace that each check instance is
executed in back into a globally shared mount namespace inside
each individual test mount namespace.
i.e. when check uses private namespaces I can see all the mounts
from inside each test namespace from the init namespace and every
test can see every mount that every other test runs again.
That is the problem I originally used mount namespaces in
check-parallel to avoid.
I have no idea if this is how mount namespace nesting is actually
supposed to work (seems completely broken to me!), but the only
solution I've found that works so far is to turn off HAVE_PRIVATENS
in check as it is redundant when it is run from check-parallel.
FWIW, given that check-parallel now runs in it's own private PID
namespace with it's own /proc and /tmp, the original problem of
needing to "confine pkill to only the child processes of this test
instance" has gone away entirely. i.e. check-parallel does not need check to
to restrict pkill to children of the current test being run anymore.
Hence I think we can probably remove the new process isolation
shenanigans and revert the _pkill wrappers to plain pkill calls
again as the private PID namespacing the check-parallel does means
pkill does the right thing for both check and check-parallel now.
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2025-03-06 11:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 9:49 [PATCH v2 0/2] isolate privatens way Zorro Lang
2025-03-06 9:49 ` [PATCH v2 1/2] check: disable HAVE_PRIVATENS by default Zorro Lang
2025-03-06 11:05 ` Dave Chinner [this message]
2025-03-06 13:47 ` Zorro Lang
2025-03-06 20:56 ` Dave Chinner
2025-03-07 15:47 ` Zorro Lang
2025-03-11 21:19 ` Dave Chinner
2025-03-06 9:49 ` [PATCH v2 2/2] check: remove the deprecation of sessionid Zorro Lang
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=Z8mBacJNAj6gVd7N@dread.disaster.area \
--to=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=zlang@kernel.org \
/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