summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-10-13 00:11:06 +0200
committerChristian Brauner <brauner@kernel.org>2026-10-14 22:08:05 +0200
commit9cd0df397a119d6b95ad68e2c82b69b4d620694e (patch)
treefa68948d222f4718c34cc931d30275e325608cc9 /kernel
parent98b6cf102b35b2bb48d1fd74d5f664eb66fe83eb (diff)
downloadlinux-9cd0df397a119d6b95ad68e2c82b69b4d620694e.tar.gz
linux-9cd0df397a119d6b95ad68e2c82b69b4d620694e.zip
fs: pass flags to copy_fs()
Turn the umh boolean into a flags argument. Idle threads need their own case in copy_fs() as well and that's nicer than a second boolean. No functional changes. Link: https://patch.msgid.link/20261013-work-fs-idle_fs-v1-1-2063d1bcb5aa@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index eb198c8dfdc7..947136cdd115 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1619,7 +1619,12 @@ static int copy_exec_state(u64 clone_flags, struct task_struct *tsk)
return task_exec_state_copy(tsk);
}
-static int copy_fs(u64 clone_flags, struct task_struct *tsk, bool umh)
+enum copy_fs_flags_t {
+ COPY_FS_UMH = (1 << 0),
+};
+
+static int copy_fs(u64 clone_flags, struct task_struct *tsk,
+ enum copy_fs_flags_t flags)
{
struct fs_struct *fs;
@@ -1629,7 +1634,7 @@ static int copy_fs(u64 clone_flags, struct task_struct *tsk, bool umh)
* filesystem state, or be started from a non-initial mount
* namespace.
*/
- if (umh) {
+ if (flags & COPY_FS_UMH) {
if (clone_flags & (CLONE_NEWNS | CLONE_FS))
return -EINVAL;
if (current->nsproxy->mnt_ns != &init_mnt_ns)
@@ -2299,7 +2304,7 @@ __latent_entropy struct task_struct *copy_process(
retval = copy_files(clone_flags, p, args->no_files);
if (retval)
goto bad_fork_cleanup_semundo;
- retval = copy_fs(clone_flags, p, args->umh);
+ retval = copy_fs(clone_flags, p, args->umh ? COPY_FS_UMH : 0);
if (retval)
goto bad_fork_cleanup_files;
retval = copy_sighand(clone_flags, p);