lkml.org 
[lkml]   [2026]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH RFC v2 02/23] fs: add scoped_with_init_fs()
On Fri, Mar 6, 2026 at 12:30 AM Christian Brauner <brauner@kernel.org> wrote:
> Similar to scoped_with_kernel_creds() allow a temporary override of
> current->fs to serve the few places where lookup is performed from
> kthread context or needs init's filesytem state.
>
> Signed-off-by: Christian Brauner <brauner@kernel.org>
[...]
> +static inline struct fs_struct *__override_init_fs(void)
> +{
> + struct fs_struct *fs;
> +
> + fs = current->fs;
> + smp_store_release(&current->fs, current->fs);
> + return fs;
> +}

See my comments on patch 15 - I think you'll have to reorder this
patch after the introduction of task_struct::real_fs and changing
procfs to access task_struct::real_fs.

I'm not sure what the smp_store_release() is supposed to pair with; if
you get rid of remote access to task_struct::fs as I suggest on patch
15, it could be a plain store, otherwise it would have to happen under
task_lock().

\
 
 \ /
  Last update: 2026-03-09 16:26    [W:0.260 / U:1.969 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog