lkml.org 
[lkml]   [2022]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] Fix regression due to "fs: move binfmt_misc sysctl to its own file"
On Mon, Feb 7, 2022 at 1:46 PM Luis Chamberlain <mcgrof@kernel.org> wrote:
>
> OK I think the issue here should have been that declaring this on
> fs/binfmt_misc.c creates the chicken and the egg issue, and so we
> need to do this on built-in code. Instead of your patch can you try
> this instead, it just always creates the sysctl mount always now
> so long as proc sysctl is enabled. It does not do the unregistration
> as we always want the path present as it used to be before as well.
>
> diff --git a/fs/file_table.c b/fs/file_table.c
> index 57edef16dce4..4f4739c9405c 100644
> --- a/fs/file_table.c
> +++ b/fs/file_table.c
> @@ -119,6 +119,7 @@ static struct ctl_table fs_stat_sysctls[] = {
> static int __init init_fs_stat_sysctls(void)
> {
> register_sysctl_init("fs", fs_stat_sysctls);
> + register_sysctl_mount_point("fs/binfmt_misc");
> return 0;
> }
> fs_initcall(init_fs_stat_sysctls);

I'm looking at the original code, and it seems that if we don't select
CONFIG_BINFMT_MISC at all,
this file won't be created. This would suggest an IF MACRO around
> + register_sysctl_mount_point("fs/binfmt_misc");
and it should looks like
+#if IS_ENABLED(CONFIG_BINFMT_MISC)
+ register_sysctl_mount_point("fs/binfmt_misc");
+#endif
or if you prefer original style:
#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)

- Tong

\
 
 \ /
  Last update: 2022-02-07 23:54    [W:0.089 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site