mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 12:16:41 +00:00
sysctl-6.4-rc1-v2
As mentioned on my first pull request for sysctl-next, for v6.4-rc1 we're very close to being able to deprecating register_sysctl_paths(). I was going to assess the situation after the first week of the merge window. That time is now and things are looking good. We only have one stragglers on the patch which had already an ACK for so I'm picking this up here now and the last patch is the one that uses an axe. Some careful eyeballing would be appreciated by others. If this doesn't get properly reviewed I can also just hold off on this in my tree for the next merge window. Either way is fine by me. I have boot tested the last patch and 0-day build completed successfully. -----BEGIN PGP SIGNATURE----- iQJGBAABCgAwFiEENnNq2KuOejlQLZofziMdCjCSiKcFAmRSsn0SHG1jZ3JvZkBr ZXJuZWwub3JnAAoJEM4jHQowkoinzzMQAK6ddUwQM32z6E2SY/Ku6ZDQJhVKxE+Y +HvghMqaGzr2eawEaASZzV6p//Q1aH4c2yaChyENa/O82QBXhbc2RBvdiAzQeJZx cUQ4C6Lc+BlpoB24Nes69F9j1LAEI5YXKMK911DKDu7LNNS7Ytxt1IOfM2RpyqRV 6+9vOvAqCSh9EEjZeZDrMlsYhBA+t3YIkU6JFMX7Upc2P7m//57inLsZyUZBqnou t9sfC0d1lDTZXZ0vSIk534VhoxXe1MkYERKkAciEprxbdNnqcsi4WMXKdXG6Mcpy O1ZuUXqndAfhTSHLkqNidtuDP29TTvcdz5tDfwmaJ3JUTt0cDvlC2T7J9WyXDfCZ XsR8Ik0/vEH/j9rVabF9fQ8DeTSLe9AgpaItHd6/LWI8UESs5k/wYi9O+7lhCf2p JZpXl3G1itKA9ABMD1GUEtC5hfWTUxkTEgPkXbqFuKtCl0mI8lD3FPFRbuhYNLa8 7R/6SN9h6/43C9Ffp2bY3c/gKQj51QlvGOSctahvdYSFkG8KXKhEnsDu0V6eLM9G QYrhvht8o9jbuKJKtEno9fjTlClVvXp5vARQQyy9OHyTuhU/Y8q2lH2BCZtFYZrM cpIFdfqB18tZmo7QfNHZPLfws2j3MqsbXFG8Q23BB7cJp1P5QdLJjmjnqbMq8xmk 3kdRMZ2Xkfcx =8VOt -----END PGP SIGNATURE----- Merge tag 'sysctl-6.4-rc1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull more sysctl updates from Luis Chamberlain: "As mentioned on my first pull request for sysctl-next, for v6.4-rc1 we're very close to being able to deprecating register_sysctl_paths(). I was going to assess the situation after the first week of the merge window. That time is now and things are looking good. We only have one which had already an ACK for so I'm picking this up here now and the last patch is the one that uses an axe. I have boot tested the last patch and 0-day build completed successfully" * tag 'sysctl-6.4-rc1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: sysctl: remove register_sysctl_paths() kernel: pid_namespace: simplify sysctls with register_sysctl()
This commit is contained in:
commit
049a18f232
@ -1575,25 +1575,18 @@ static int register_leaf_sysctl_tables(const char *path, char *pos,
|
||||
}
|
||||
|
||||
/**
|
||||
* __register_sysctl_paths - register a sysctl table hierarchy
|
||||
* @set: Sysctl tree to register on
|
||||
* @path: The path to the directory the sysctl table is in.
|
||||
* register_sysctl_table - register a sysctl table hierarchy
|
||||
* @table: the top-level table structure
|
||||
*
|
||||
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
||||
* array. A completely 0 filled entry terminates the table.
|
||||
* We are slowly deprecating this call so avoid its use.
|
||||
*
|
||||
* See __register_sysctl_table for more details.
|
||||
*/
|
||||
struct ctl_table_header *__register_sysctl_paths(
|
||||
struct ctl_table_set *set,
|
||||
const struct ctl_path *path, struct ctl_table *table)
|
||||
struct ctl_table_header *register_sysctl_table(struct ctl_table *table)
|
||||
{
|
||||
struct ctl_table *ctl_table_arg = table;
|
||||
int nr_subheaders = count_subheaders(table);
|
||||
struct ctl_table_header *header = NULL, **subheaders, **subheader;
|
||||
const struct ctl_path *component;
|
||||
char *new_path, *pos;
|
||||
|
||||
pos = new_path = kmalloc(PATH_MAX, GFP_KERNEL);
|
||||
@ -1601,11 +1594,6 @@ struct ctl_table_header *__register_sysctl_paths(
|
||||
return NULL;
|
||||
|
||||
pos[0] = '\0';
|
||||
for (component = path; component->procname; component++) {
|
||||
pos = append_path(new_path, pos, component->procname);
|
||||
if (!pos)
|
||||
goto out;
|
||||
}
|
||||
while (table->procname && table->child && !table[1].procname) {
|
||||
pos = append_path(new_path, pos, table->procname);
|
||||
if (!pos)
|
||||
@ -1613,7 +1601,7 @@ struct ctl_table_header *__register_sysctl_paths(
|
||||
table = table->child;
|
||||
}
|
||||
if (nr_subheaders == 1) {
|
||||
header = __register_sysctl_table(set, new_path, table);
|
||||
header = __register_sysctl_table(&sysctl_table_root.default_set, new_path, table);
|
||||
if (header)
|
||||
header->ctl_table_arg = ctl_table_arg;
|
||||
} else {
|
||||
@ -1627,7 +1615,7 @@ struct ctl_table_header *__register_sysctl_paths(
|
||||
header->ctl_table_arg = ctl_table_arg;
|
||||
|
||||
if (register_leaf_sysctl_tables(new_path, pos, &subheader,
|
||||
set, table))
|
||||
&sysctl_table_root.default_set, table))
|
||||
goto err_register_leaves;
|
||||
}
|
||||
|
||||
@ -1646,41 +1634,6 @@ struct ctl_table_header *__register_sysctl_paths(
|
||||
header = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/**
|
||||
* register_sysctl_paths - register a sysctl table hierarchy
|
||||
* @path: The path to the directory the sysctl table is in.
|
||||
* @table: the top-level table structure
|
||||
*
|
||||
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
||||
* array. A completely 0 filled entry terminates the table.
|
||||
* We are slowly deprecating this caller so avoid future uses of it.
|
||||
*
|
||||
* See __register_sysctl_paths for more details.
|
||||
*/
|
||||
struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
|
||||
struct ctl_table *table)
|
||||
{
|
||||
return __register_sysctl_paths(&sysctl_table_root.default_set,
|
||||
path, table);
|
||||
}
|
||||
EXPORT_SYMBOL(register_sysctl_paths);
|
||||
|
||||
/**
|
||||
* register_sysctl_table - register a sysctl table hierarchy
|
||||
* @table: the top-level table structure
|
||||
*
|
||||
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
||||
* array. A completely 0 filled entry terminates the table.
|
||||
*
|
||||
* See register_sysctl_paths for more details.
|
||||
*/
|
||||
struct ctl_table_header *register_sysctl_table(struct ctl_table *table)
|
||||
{
|
||||
static const struct ctl_path null_path[] = { {} };
|
||||
|
||||
return register_sysctl_paths(null_path, table);
|
||||
}
|
||||
EXPORT_SYMBOL(register_sysctl_table);
|
||||
|
||||
int __register_sysctl_base(struct ctl_table *base_table)
|
||||
|
@ -221,14 +221,8 @@ extern void retire_sysctl_set(struct ctl_table_set *set);
|
||||
struct ctl_table_header *__register_sysctl_table(
|
||||
struct ctl_table_set *set,
|
||||
const char *path, struct ctl_table *table);
|
||||
struct ctl_table_header *__register_sysctl_paths(
|
||||
struct ctl_table_set *set,
|
||||
const struct ctl_path *path, struct ctl_table *table);
|
||||
struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table);
|
||||
struct ctl_table_header *register_sysctl_table(struct ctl_table * table);
|
||||
struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
|
||||
struct ctl_table *table);
|
||||
|
||||
void unregister_sysctl_table(struct ctl_table_header * table);
|
||||
|
||||
extern int sysctl_init_bases(void);
|
||||
@ -277,12 +271,6 @@ static inline struct ctl_table_header *register_sysctl_mount_point(const char *p
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct ctl_table_header *register_sysctl_paths(
|
||||
const struct ctl_path *path, struct ctl_table *table)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table)
|
||||
{
|
||||
return NULL;
|
||||
|
@ -314,7 +314,6 @@ static struct ctl_table pid_ns_ctl_table[] = {
|
||||
},
|
||||
{ }
|
||||
};
|
||||
static struct ctl_path kern_path[] = { { .procname = "kernel", }, { } };
|
||||
#endif /* CONFIG_CHECKPOINT_RESTORE */
|
||||
|
||||
int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd)
|
||||
@ -473,7 +472,7 @@ static __init int pid_namespaces_init(void)
|
||||
pid_ns_cachep = KMEM_CACHE(pid_namespace, SLAB_PANIC | SLAB_ACCOUNT);
|
||||
|
||||
#ifdef CONFIG_CHECKPOINT_RESTORE
|
||||
register_sysctl_paths(kern_path, pid_ns_ctl_table);
|
||||
register_sysctl_init("kernel", pid_ns_ctl_table);
|
||||
#endif
|
||||
|
||||
register_pid_ns_sysctl_table_vm();
|
||||
|
@ -46,10 +46,9 @@ static struct ctl_table pid_ns_ctl_table_vm[] = {
|
||||
},
|
||||
{ }
|
||||
};
|
||||
static struct ctl_path vm_path[] = { { .procname = "vm", }, { } };
|
||||
static inline void register_pid_ns_sysctl_table_vm(void)
|
||||
{
|
||||
register_sysctl_paths(vm_path, pid_ns_ctl_table_vm);
|
||||
register_sysctl("vm", pid_ns_ctl_table_vm);
|
||||
}
|
||||
#else
|
||||
static inline void initialize_memfd_noexec_scope(struct pid_namespace *ns) {}
|
||||
|
@ -156,22 +156,6 @@ curtable && /\.procname[\t ]*=[\t ]*".+"/ {
|
||||
}
|
||||
}
|
||||
|
||||
/register_sysctl_paths\(.*\)/ {
|
||||
match($0, /register_sysctl_paths\(([^)]+), ([^)]+)\)/, tables)
|
||||
if (debug) print "Attaching table " tables[2] " to path " tables[1]
|
||||
if (paths[tables[1]] == table) {
|
||||
for (entry in entries[tables[2]]) {
|
||||
printentry(entry)
|
||||
}
|
||||
}
|
||||
split(paths[tables[1]], components, "/")
|
||||
if (length(components) > 1 && components[1] == table) {
|
||||
# Count the first subdirectory as seen
|
||||
seen[components[2]]++
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
END {
|
||||
for (entry in documented) {
|
||||
if (!seen[entry]) {
|
||||
|
Loading…
Reference in New Issue
Block a user