Re: [PATCH RFC v3 21/26] fs: add kthread_mntns()

From: Thomas Weißschuh

Date: Wed Mar 11 2026 - 18:13:18 EST


On 2026-03-11 22:44:04+0100, Christian Brauner wrote:
> Allow kthreads to create a private mount namespace.
>
> Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
> ---
> fs/namespace.c | 30 ++++++++++++++++++++++++++++++
> include/linux/mount.h | 1 +
> 2 files changed, 31 insertions(+)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 854f4fc66469..e23d2fa7e255 100644

(...)

> diff --git a/include/linux/mount.h b/include/linux/mount.h
> index acfe7ef86a1b..69d61f21b548 100644
> --- a/include/linux/mount.h
> +++ b/include/linux/mount.h
> @@ -106,6 +106,7 @@ int do_mount(const char *, const char __user *,
> extern const struct path *collect_paths(const struct path *, struct path *, unsigned);
> extern void drop_collected_paths(const struct path *, const struct path *);
> extern void kern_unmount_array(struct vfsmount *mnt[], unsigned int num);
> +int __init kthread_mntns(void);

The usage of '__init' needs an '#include <linux/init.h>', otherwise
compilation fails in some cases. Or drop the '__init' altogether, as
it has no meaning in a declaration anyways.

> extern int cifs_root_data(char **dev, char **opts);
>
>
> --
> 2.47.3
>