Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/7] fsmount: add FSMOUNT_NAMESPACE
@ 2026-01-22 10:48 Christian Brauner
  2026-01-22 10:48 ` [PATCH 1/7] mount: start iterating from start of rbtree Christian Brauner
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Christian Brauner @ 2026-01-22 10:48 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Alexander Viro, Jan Kara, Jeff Layton, Amir Goldstein,
	Josef Bacik, Aleksa Sarai, Christian Brauner

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-20 14:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-22 10:48 [PATCH 0/7] fsmount: add FSMOUNT_NAMESPACE Christian Brauner
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox