Skip to contentSkip to conversation

random-move-the-random-sysctl-declarations-to-its-own-file.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jan 23, 2022

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: random: move the random sysctl declarations to its own file
has been removed from the -mm tree. Its filename was
random-move-the-random-sysctl-declarations-to-its-own-file.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Xiaoming Ni <[email protected]>
Subject: random: move the random sysctl declarations to its own file

kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain.

To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic.

So move the random sysctls to their own file and use register_sysctl_init().

[[email protected]: commit log update to justify the move]
Cc Al Viro <[email protected]>
Cc Amir Goldstein <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Antti Palosaari <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Benjamin LaHaise <[email protected]>
Cc Clemens Ladisch <[email protected]>
Cc David Airlie <[email protected]>
Cc Douglas Gilbert <[email protected]>
Cc Eric Biederman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Iurii Zaikin <[email protected]>
Cc James E.J. Bottomley <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jan Kara <[email protected]>
Cc Joel Becker <[email protected]>
Cc John Ogness <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Joseph Qi <[email protected]>
Cc Julia Lawall <[email protected]>
Cc Kees Cook <[email protected]>
Cc Lukas Middendorf <[email protected]>
Cc Mark Fasheh <[email protected]>
Cc Martin K. Petersen <[email protected]>
Cc Paul Turner <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Phillip Potter <[email protected]>
Cc Qing Wang <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Stephen Kitt <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Tetsuo Handa <[email protected]>
Cc "Theodore Ts'o" <[email protected]>

---

 drivers/char/random.c  |   14 ++++++++++++--
 include/linux/sysctl.h |    1 -
 kernel/sysctl.c        |    5 -----
 3 files changed, 12 insertions(+), 8 deletions(-)
drivers/char/random.c renamed from drivers/char/random.c~random-move-the-random-sysctl-declarations-to-its-own-file +12 -2
@@ -1992,8 +1992,7 @@ static int proc_do_entropy(struct ctl_ta
 }
 
 static int sysctl_poolsize = POOL_BITS;
-extern struct ctl_table random_table[];
-struct ctl_table random_table[] = {
+static struct ctl_table random_table[] = {
 	{
 		.procname	= "poolsize",
 		.data		= &sysctl_poolsize,
@@ -2055,6 +2054,17 @@ struct ctl_table random_table[] = {
 #endif
 	{ }
 };
+
+/*
+ * rand_initialize() is called before sysctl_init(),
+ * so we cannot call register_sysctl_init() in rand_initialize()
+ */
+static int __init random_sysctls_init(void)
+{
+	register_sysctl_init("kernel/random", random_table);
+	return 0;
+}
+device_initcall(random_sysctls_init);
 #endif	/* CONFIG_SYSCTL */
 
 struct batched_entropy {
include/linux/sysctl.h renamed from include/linux/sysctl.h~random-move-the-random-sysctl-declarations-to-its-own-file +0 -1
@@ -217,7 +217,6 @@ extern int unaligned_dump_stack;
 extern int no_unaligned_warning;
 
 extern struct ctl_table sysctl_mount_point[];
-extern struct ctl_table random_table[];
 
 #else /* CONFIG_SYSCTL */
 static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table)
kernel/sysctl.c renamed from kernel/sysctl.c~random-move-the-random-sysctl-declarations-to-its-own-file +0 -5
@@ -2145,11 +2145,6 @@ static struct ctl_table kern_table[] = {
 		.proc_handler	= sysctl_max_threads,
 	},
 	{
-		.procname	= "random",
-		.mode		= 0555,
-		.child		= random_table,
-	},
-	{
 		.procname	= "usermodehelper",
 		.mode		= 0555,
 		.child		= usermodehelper_table,

_

Patches currently in -mm which might be from [email protected] are