From: Matt Turner <mattst88@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: Re: [gentoo-catalyst] [PATCH] catalyst: Restore root and cwd after exiting mount namespace
Date: Sat, 14 Nov 2020 11:40:52 -0500 [thread overview]
Message-ID: <CAEdQ38Es_iQ_0p4yV8udTa8pdRwMjDyp_b_FmSN-GVqpjs3_tQ@mail.gmail.com> (raw)
In-Reply-To: <5fa82ef4b4010271be53a5d5c94e5c19b81f2bb3.camel@rohde-schwarz.com>
On Mon, Nov 9, 2020 at 2:36 PM Felix Bier <Felix.Bier@rohde-schwarz.com> wrote:
>
> This commit saves the file descriptor of /proc/self/{root,cwd}
> before entering into the new mount namespace. When restoring the
> previous mount namespace, it restores /proc/self/{root,cwd}
> based on the saved file descriptors.
>
> Without this change, catalyst cannot be run in a chroot when
> using the recent changes regarding mount namespaces: After the
> mount namespace has been exited, /proc/self/root points to the "/"
> of the host system, not the "/" of the chroot. Therefore, the
> cleanup phase of catalyst runs outside of the chroot.
>
> The code is similar to how nsenter(1) sets root and cwd:
> https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/sys-utils/nsenter.c#n452
>
> Tested in a Gentoo chroot and in Gentoo VM (non-chroot).
>
> Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com>
Very nice. Thanks a bunch!
I've committed all four patches, but not until I munged them: I
stripped out all the headers except From/Date/Subject (and modified
subject to remove [gentoo-catalyst], etc; then ran base64 -d on the
body. Only then could I get the patches to apply. I really don't
understand why. I've never had to do this before. Maybe you're sending
the patches from a branch with a bunch of other work on it?
I'd suggest making a fresh clone of catalyst and trying to apply the
patches yourself to see if you can determine what's going on.
prev parent reply other threads:[~2020-11-14 16:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 19:36 [gentoo-catalyst] [PATCH] catalyst: Restore root and cwd after exiting mount namespace Felix Bier
2020-11-14 16:40 ` Matt Turner [this message]
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=CAEdQ38Es_iQ_0p4yV8udTa8pdRwMjDyp_b_FmSN-GVqpjs3_tQ@mail.gmail.com \
--to=mattst88@gentoo.org \
--cc=gentoo-catalyst@lists.gentoo.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