From: Christian Brauner <brauner@kernel.org>
To: linux-fsdevel@vger.kernel.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
Jeff Layton <jlayton@kernel.org>,
Amir Goldstein <amir73il@gmail.com>,
Josef Bacik <josef@toxicpanda.com>,
Aleksa Sarai <cyphar@cyphar.com>,
Christian Brauner <brauner@kernel.org>
Subject: [PATCH 0/7] fsmount: add FSMOUNT_NAMESPACE
Date: Thu, 22 Jan 2026 11:48:45 +0100 [thread overview]
Message-ID: <20260122-work-fsmount-namespace-v1-0-5ef0a886e646@kernel.org> (raw)
Add FSMOUNT_NAMESPACE flag to fsmount() that creates a new mount
namespace with the newly created filesystem attached to a copy of the
real rootfs. This returns a namespace file descriptor instead of an
O_PATH mount fd, similar to how OPEN_TREE_NAMESPACE works for
open_tree().
This allows creating a new filesystem and immediately placing it in a
new mount namespace in a single operation, which is useful for container
runtimes and other namespace-based isolation mechanisms.
This accompanies OPEN_TREE_NAMESPACE and avoids a needless detour via
OPEN_TREE_NAMESPACE to get the same effect. Will be especially useful
when you mount an actual filesystem to be used as the container rootfs.
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
Christian Brauner (7):
mount: start iterating from start of rbtree
mount: simplify __do_loopback()
mount: add FSMOUNT_NAMESPACE
tools: update mount.h header
selftests/statmount: add statmount_alloc() helper
selftests: add FSMOUNT_NAMESPACE tests
selftests/open_tree_ns: fix compilation
fs/namespace.c | 84 +-
include/uapi/linux/mount.h | 1 +
tools/include/uapi/linux/mount.h | 14 +-
.../selftests/filesystems/fsmount_ns/.gitignore | 1 +
.../selftests/filesystems/fsmount_ns/Makefile | 10 +
.../filesystems/fsmount_ns/fsmount_ns_test.c | 1138 ++++++++++++++++++++
.../selftests/filesystems/open_tree_ns/Makefile | 2 +-
.../filesystems/open_tree_ns/open_tree_ns_test.c | 33 +-
.../selftests/filesystems/statmount/statmount.h | 27 +
9 files changed, 1242 insertions(+), 68 deletions(-)
---
base-commit: 1bce1a664ac25d37a327c433a01bc347f0a81bd6
change-id: 20260121-work-fsmount-namespace-4242e3df359e
next reply other threads:[~2026-01-22 10:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 10:48 Christian Brauner [this message]
2026-01-22 10:48 ` [PATCH 1/7] mount: start iterating from start of rbtree Christian Brauner
2026-01-22 10:48 ` [PATCH 2/7] mount: simplify __do_loopback() Christian Brauner
2026-01-22 10:48 ` [PATCH 3/7] mount: add FSMOUNT_NAMESPACE Christian Brauner
2026-02-11 11:47 ` Mark Brown
2026-02-11 12:13 ` Christian Brauner
2026-03-18 20:16 ` Mark Brown
2026-03-20 13:40 ` Christian Brauner
2026-03-20 14:04 ` Mark Brown
2026-01-22 10:48 ` [PATCH 4/7] tools: update mount.h header Christian Brauner
2026-01-22 10:48 ` [PATCH 5/7] selftests/statmount: add statmount_alloc() helper Christian Brauner
2026-01-22 10:48 ` [PATCH 6/7] selftests: add FSMOUNT_NAMESPACE tests Christian Brauner
2026-01-22 10:48 ` [PATCH 7/7] selftests/open_tree_ns: fix compilation Christian Brauner
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=20260122-work-fsmount-namespace-v1-0-5ef0a886e646@kernel.org \
--to=brauner@kernel.org \
--cc=amir73il@gmail.com \
--cc=cyphar@cyphar.com \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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