Skip to content

Commit 2abc26f

Browse files
ebiedermLinus Torvalds
authored andcommitted
[PATCH] sysctl: create sys/fs/binfmt_misc as an ordinary sysctl entry
binfmt_misc has a mount point in the middle of the sysctl and that mount point is created as a proc_generic directory. Doing it that way gets in the way of cleaning up the sysctl proc support as it continues the existence of a horrible hack. So instead simply create the directory as an ordinary sysctl directory. At least that removes the magic special case. [[email protected]: warning fix] Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a5494dc commit 2abc26f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

fs/proc/root.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ void __init proc_root_init(void)
7373
#endif
7474
#ifdef CONFIG_SYSCTL
7575
proc_sys_root = proc_mkdir("sys", NULL);
76-
#endif
77-
#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
78-
proc_mkdir("sys/fs", NULL);
79-
proc_mkdir("sys/fs/binfmt_misc", NULL);
8076
#endif
8177
proc_root_fs = proc_mkdir("fs", NULL);
8278
proc_root_driver = proc_mkdir("driver", NULL);

kernel/sysctl.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,12 @@ static ctl_table vm_table[] = {
881881
{ .ctl_name = 0 }
882882
};
883883

884+
#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
885+
static ctl_table binfmt_misc_table[] = {
886+
{ .ctl_name = 0 }
887+
};
888+
#endif
889+
884890
static ctl_table fs_table[] = {
885891
{
886892
.ctl_name = FS_NRINODE,
@@ -1004,6 +1010,14 @@ static ctl_table fs_table[] = {
10041010
.mode = 0644,
10051011
.proc_handler = &proc_dointvec,
10061012
},
1013+
#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1014+
{
1015+
.ctl_name = CTL_UNNUMBERED,
1016+
.procname = "binfmt_misc",
1017+
.mode = 0555,
1018+
.child = binfmt_misc_table,
1019+
},
1020+
#endif
10071021
{ .ctl_name = 0 }
10081022
};
10091023

0 commit comments

Comments
 (0)