mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 14:04:27 -04:00
devtmpfs: create private mount namespace
Kernel threads start in a completely isolated nullfs mount. Use UNSHARE_EMPTY_MNTNS to give the devtmpfsd kthread a private empty mount namespace with its root and pwd already set up, so it can mount its own devtmpfs instance instead of unsharing a copy of the initial mount namespace. Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-21-77ee053060e0@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
@@ -413,7 +413,7 @@ static noinline int __init devtmpfs_setup(void *p)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = ksys_unshare(CLONE_NEWNS);
|
||||
err = ksys_unshare(UNSHARE_EMPTY_MNTNS);
|
||||
if (err)
|
||||
goto out;
|
||||
err = init_mount("devtmpfs", "/", "devtmpfs", DEVTMPFS_MFLAGS, NULL);
|
||||
|
||||
Reference in New Issue
Block a user