Message ID | 20240314-jag-sysctl_remset_net-v1-0-aa26b44d29d9@samsung.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Thu, 14 Mar 2024 20:20:40 +0100 Joel Granados via B4 Relay wrote: > These commits remove the sentinel element (last empty element) from the > sysctl arrays of all the files under the "net/" directory that register > a sysctl array. The merging of the preparation patches [4] to mainline > allows us to just remove sentinel elements without changing behavior. > This is safe because the sysctl registration code (register_sysctl() and > friends) use the array size in addition to checking for a sentinel [1]. Thanks, but please resend after the merge window, we don't apply code to -next until -rc1 is cut.
On Thu, Mar 14, 2024 at 03:42:48PM -0700, Jakub Kicinski wrote: > On Thu, 14 Mar 2024 20:20:40 +0100 Joel Granados via B4 Relay wrote: > > These commits remove the sentinel element (last empty element) from the > > sysctl arrays of all the files under the "net/" directory that register > > a sysctl array. The merging of the preparation patches [4] to mainline > > allows us to just remove sentinel elements without changing behavior. > > This is safe because the sysctl registration code (register_sysctl() and > > friends) use the array size in addition to checking for a sentinel [1]. > > Thanks, but please resend after the merge window, we don't apply > code to -next until -rc1 is cut. of course. I'll resend after -rc1 hits kernel.org. Best
diff --git i/fs/proc/proc_sysctl.c w/fs/proc/proc_sysctl.c index 37cde0efee57..896c498600e8 100644 --- i/fs/proc/proc_sysctl.c +++ w/fs/proc/proc_sysctl.c @@ -966,6 +966,7 @@ static struct ctl_dir *new_dir(struct ctl_table_set *set, table[0].procname = new_name; table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; init_header(&new->header, set->dir.header.root, set, node, table, 1); + printk("%ld sysctl saved mem kzalloc\n", sizeof(struct ctl_table)); return new; } @@ -1189,6 +1190,7 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, s> link_name += len; link++; } + printk("%ld sysctl saved mem kzalloc\n", sizeof(struct ctl_table)); init_header(links, dir->header.root, dir->header.set, node, link_table, head->ctl_table_size); links->nreg = nr_entries;