]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nstree: assign fixed ids to the initial namespaces
authorChristian Brauner <brauner@kernel.org>
Wed, 29 Oct 2025 12:20:28 +0000 (13:20 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 3 Nov 2025 16:41:17 +0000 (17:41 +0100)
commit3760342fd6312416491d536144e39297fa5b1950
tree5b25f598fc19abb03fee2b3371ac2d5a7e890e45
parent04173501a69ed0387cceb190181ef8f7f1c54f0a
nstree: assign fixed ids to the initial namespaces

The initial set of namespace comes with fixed inode numbers making it
easy for userspace to identify them solely based on that information.
This has long preceeded anything here.

Similarly, let's assign fixed namespace ids for the initial namespaces.

Kill the cookie and use a sequentially increasing number. This has the
nice side-effect that the owning user namespace will always have a
namespace id that is smaller than any of it's descendant namespaces.

Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-15-2e6f823ebdc0@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c
include/linux/ns_common.h
include/linux/nstree.h
include/uapi/linux/nsfs.h
kernel/nstree.c
net/core/net_namespace.c