LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: "<Andrew Morton" <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>, <containers@lists.osdl.org>,
	<netdev@vger.kernel.org>,
	xfs-masters@oss.sgi.com, xfs@oss.sgi.com,
	linux-scsi@vger.kernel.org, James.Bottomley@SteelEye.com,
	minyard@acm.org, openipmi-developer@lists.sourceforge.net,
	<tony.luck@intel.com>,
	linux-mips@linux-mips.org, ralf@linux-mips.org,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	linux390@de.ibm.com, linux-390@vm.marist.edu, paulus@samba.org,
	linuxppc-dev@ozlabs.org, lethal@linux-sh.org,
	linuxsh-shmedia-dev@lists.sourceforge.net, <ak@suse.de>,
	vojtech@suse.cz, clemens@ladisch.de, a.zummo@towertech.it,
	rtc-linux@googlegroups.com, linux-parport@lists.infradead.org,
	andrea@suse.de, tim@cyberelk.net, philb@gnu.org,
	aharkes@cs.cmu.edu, coda@cs.cmu.edu,
	codalist@TELEMANN.coda.cs.cmu.edu, aia21@cantab.net,
	linux-ntfs-dev@lists.sourceforge.net, mark.fasheh@oracle.com,
	kurt.hackel@oracle.com,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: [PATCH 32/59] sysctl: C99 convert arch/mips/lasat/sysctl.c and remove ABI breakage.
Date: Tue, 16 Jan 2007 09:39:37 -0700	[thread overview]
Message-ID: <11689656574092-git-send-email-ebiederm@xmission.com> (raw)
In-Reply-To: <m1ac0jc4no.fsf@ebiederm.dsl.xmission.com>

From: Eric W. Biederman <ebiederm@xmission.com> - unquoted

While C99 converting the ctl_table initializers I realized
that the binary sysctl numbers were in conflict with the binary
values under CTL_KERN.   Including CTL_KERN KERN_VERSION as used
by glibc.  So I just removed the sysctl binary interface for these
values, as it was unsupportable.

Luckily these sysctl were inserted at the end of the
sysctl list so this bug was not visible to userspace.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/mips/lasat/sysctl.c |  145 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 116 insertions(+), 29 deletions(-)

diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index 1287835..c04e82f 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -302,42 +302,129 @@ extern int lasat_boot_to_service;
 #ifdef CONFIG_SYSCTL
 
 static ctl_table lasat_table[] = {
-	{LASAT_CPU_HZ, "cpu-hz", &lasat_board_info.li_cpu_hz, sizeof(int),
-	 0444, NULL, &proc_dointvec, &sysctl_intvec},
-	{LASAT_BUS_HZ, "bus-hz", &lasat_board_info.li_bus_hz, sizeof(int),
-	 0444, NULL, &proc_dointvec, &sysctl_intvec},
-	{LASAT_MODEL, "bmid", &lasat_board_info.li_bmid, sizeof(int),
-	 0444, NULL, &proc_dointvec, &sysctl_intvec},
-	{LASAT_PRID, "prid", &lasat_board_info.li_prid, sizeof(int),
-	 0644, NULL, &proc_lasat_eeprom_value, &sysctl_lasat_eeprom_value},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "cpu-hz",
+		.data		= &lasat_board_info.li_cpu_hz,
+		.maxlen		= sizeof(int),
+		.mode		= 0444,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_intvec
+	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "bus-hz",
+		.data		= &lasat_board_info.li_bus_hz,
+		.maxlen		= sizeof(int),
+		.mode		= 0444,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_intvec
+	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "bmid",
+		.data		= &lasat_board_info.li_bmid,
+		.maxlen		= sizeof(int),
+		.mode		= 0444,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_intvec
+	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "prid",
+		.data		= &lasat_board_info.li_prid,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_lasat_eeprom_value,
+		.strategy	= &sysctl_lasat_eeprom_value
+	},
 #ifdef CONFIG_INET
-	{LASAT_IPADDR, "ipaddr", &lasat_board_info.li_eeprom_info.ipaddr, sizeof(int),
-	 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec},
-	{LASAT_NETMASK, "netmask", &lasat_board_info.li_eeprom_info.netmask, sizeof(int),
-	 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec},
-	{LASAT_BCAST, "bcastaddr", &lasat_bcastaddr,
-		sizeof(lasat_bcastaddr), 0600, NULL,
-		&proc_dostring, &sysctl_string},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "ipaddr",
+		.data		= &lasat_board_info.li_eeprom_info.ipaddr,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_lasat_ip,
+		.strategy	= &sysctl_lasat_intvec
+	},
+	{
+		.ctl_name	= LASAT_NETMASK,
+		.procname	= "netmask",
+		.data		= &lasat_board_info.li_eeprom_info.netmask,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_lasat_ip,
+		.strategy	= &sysctl_lasat_intvec
+	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "bcastaddr",
+		.data		= &lasat_bcastaddr,
+		.maxlen		= sizeof(lasat_bcastaddr),
+		.mode		= 0600,
+		.proc_handler	= &proc_dostring,
+		.strategy	= &sysctl_string
+	},
 #endif
-	{LASAT_PASSWORD, "passwd_hash", &lasat_board_info.li_eeprom_info.passwd_hash, sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
-	 0600, NULL, &proc_dolasatstring, &sysctl_lasatstring},
-	{LASAT_SBOOT, "boot-service", &lasat_boot_to_service, sizeof(int),
-	 0644, NULL, &proc_dointvec, &sysctl_intvec},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "passwd_hash",
+		.data		= &lasat_board_info.li_eeprom_info.passwd_hash,
+		.maxlen		= sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
+		.mode		= 0600,
+		.proc_handler	= &proc_dolasatstring,
+		.strategy	= &sysctl_lasatstring
+	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "boot-service",
+		.data		= &lasat_boot_to_service,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_intvec
+	},
 #ifdef CONFIG_DS1603
-	{LASAT_RTC, "rtc", &rtctmp, sizeof(int),
-	 0644, NULL, &proc_dolasatrtc, &sysctl_lasat_rtc},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "rtc",
+		.data		= &rtctmp,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dolasatrtc,
+		.strategy	= &sysctl_lasat_rtc
+	},
 #endif
-	{LASAT_NAMESTR, "namestr", &lasat_board_info.li_namestr, sizeof(lasat_board_info.li_namestr),
-	 0444, NULL, &proc_dostring, &sysctl_string},
-	{LASAT_TYPESTR, "typestr", &lasat_board_info.li_typestr, sizeof(lasat_board_info.li_typestr),
-	 0444, NULL, &proc_dostring, &sysctl_string},
-	{0}
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "namestr",
+		.data		= &lasat_board_info.li_namestr,
+		.maxlen		= sizeof(lasat_board_info.li_namestr),
+		.mode		= 0444,
+		.proc_handler	=  &proc_dostring,
+		.strategy	= &sysctl_string
+	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "typestr",
+		.data		= &lasat_board_info.li_typestr,
+		.maxlen		= sizeof(lasat_board_info.li_typestr),
+		.mode		= 0444,
+		.proc_handler	= &proc_dostring,
+		.strategy	= &sysctl_string
+	},
+	{}
 };
 
-#define CTL_LASAT 1	// CTL_ANY ???
 static ctl_table lasat_root_table[] = {
-	{ CTL_LASAT, "lasat", NULL, 0, 0555, lasat_table },
-	{ 0 }
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "lasat",
+		.mode		=  0555,
+		.child		= lasat_table
+	},
+	{}
 };
 
 static int __init lasat_register_sysctl(void)
-- 
1.4.4.1.g278f


  parent reply	other threads:[~2007-01-16 17:00 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16 16:33 [PATCH 0/59] Cleanup sysctl Eric W. Biederman
2007-01-16 16:39 ` [PATCH 1/59] sysctl x25: Remove unnecessary insert_at_head from register_sysctl_table Eric W. Biederman
2007-01-16 16:39 ` [PATCH 2/59] sysctl: Move CTL_SUNRPC to sysctl.h where it belongs Eric W. Biederman
2007-01-16 16:39 ` [PATCH 3/59] sysctl: sunrpc Remove unnecessary insert_at_head flag Eric W. Biederman
2007-01-16 16:39 ` [PATCH 4/59] sysctl: sunrpc Don't unnecessarily set ctl_table->de Eric W. Biederman
2007-01-16 16:39 ` [PATCH 5/59] sysctl: rose remove unnecessary insert_at_head flag Eric W. Biederman
2007-01-16 17:36   ` Ralf Baechle
2007-01-16 16:39 ` [PATCH 6/59] sysctl: netrom " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 7/59] sysctl: llc " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 8/59] sysctl: ipx " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 9/59] sysctl: decnet " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 10/59] sysctl: dccp " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 11/59] sysctl: ax25 " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 12/59] sysctl: atalk " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 13/59] sysctl: xfs " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 14/59] sysctl: C99 convert xfs ctl_tables Eric W. Biederman
2007-01-16 18:16   ` Alexey Dobriyan
2007-01-16 18:37     ` Eric W. Biederman
2007-01-16 18:45     ` [PATCH] sysctl: fixes for my C99 converion " Eric W. Biederman
2007-01-17 17:01   ` [PATCH 14/59] sysctl: C99 convert " Kirill Korotaev
2007-01-17 17:37   ` [xfs-masters] " Eric Sandeen
2007-01-16 16:39 ` [PATCH 15/59] sysctl: scsi remove unnecessary insert_at_head flag Eric W. Biederman
2007-01-16 16:39 ` [PATCH 16/59] sysctl: md Remove " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 17/59] sysctl: mac_hid remove " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 18/59] sysctl: ipmi " Eric W. Biederman
2007-01-17  3:14   ` Benjamin Herrenschmidt
2007-01-16 16:39 ` [PATCH 19/59] sysctl: cdrom " Eric W. Biederman
2007-01-16 16:39 ` [PATCH 20/59] sysctl: cdrom Don't set de->owner Eric W. Biederman
2007-01-16 18:19   ` James Bottomley
2007-01-16 16:39 ` [PATCH 21/59] sysctl: Move CTL_PM into sysctl.h where it belongs Eric W. Biederman
2007-01-16 16:39 ` [PATCH 22/59] sysctl: frv pm remove unnecessary insert_at_head flag Eric W. Biederman
2007-01-16 16:39 ` [PATCH 23/59] sysctl: Move CTL_FRV into sysctl.h where it belongs Eric W. Biederman
2007-01-16 16:39 ` [PATCH 24/59] sysctl: frv remove unnecessary insert_at_head flag Eric W. Biederman
2007-01-16 16:39 ` [PATCH 25/59] sysctl: C99 convert arch/frv/kernel/pm.c Eric W. Biederman
2007-01-17 17:14   ` Kirill Korotaev
2007-01-22 22:21     ` Herbert Poetzl
2007-01-24  9:00     ` David Howells
2007-01-16 16:39 ` [PATCH 26/59] sysctl: C99 convert arch/frv/kernel/sysctl.c Eric W. Biederman
2007-01-16 16:39 ` [PATCH 27/59] sysctl: sn Remove sysctl ABI BREAKAGE Eric W. Biederman
2007-01-16 16:39 ` [PATCH 28/59] sysctl: C99 Convert arch/ia64/sn/kernel/xpc_main.c Eric W. Biederman
2007-01-16 16:39 ` [PATCH 29/59] sysctl: C99 convert arch/ia64/kernel/perfmon and remove ABI breakage Eric W. Biederman
2007-01-16 16:39 ` [PATCH 30/59] sysctl: mips/au1000 Remove sys_sysctl support Eric W. Biederman
2007-01-16 16:39 ` [PATCH 31/59] sysctl: C99 convert the ctl_tables in arch/mips/au1000/common/power.c Eric W. Biederman
2007-01-16 22:20   ` Ingo Oeser
2007-01-16 16:39 ` Eric W. Biederman [this message]
2007-01-16 16:39 ` [PATCH 33/59] sysctl: s390 move sysctl definitions to sysctl.h Eric W. Biederman
2007-01-17 17:23   ` Kirill Korotaev
2007-01-16 16:39 ` [PATCH 34/59] sysctl: s390 Remove unnecessary use of insert_at_head Eric W. Biederman
2007-01-16 16:39 ` [PATCH 35/59] sysctl: C99 convert ctl_tables in arch/powerpc/kernel/idle.c Eric W. Biederman
2007-01-17  3:16   ` Benjamin Herrenschmidt
2007-01-16 16:39 ` [PATCH 36/59] sysctl: C99 convert ctl_tables entries in arch/ppc/kernel/ppc_htab.c Eric W. Biederman
2007-01-17  3:16   ` Benjamin Herrenschmidt
2007-01-16 16:39 ` [PATCH 37/59] sysctl: C99 convert arch/sh64/kernel/traps.c and remove ABI breakage Eric W. Biederman
2007-01-16 22:07   ` Paul Mundt
2007-01-16 16:39 ` [PATCH 38/59] sysctl: x86_64 Remove unnecessary use of insert_at_head Eric W. Biederman
2007-01-16 16:39 ` [PATCH 39/59] sysctl: C99 convert ctl_tables in arch/x86_64/ia32/ia32_binfmt.c Eric W. Biederman
2007-01-16 16:39 ` [PATCH 40/59] sysctl: C99 convert ctl_tables in arch/x86_64/kernel/vsyscall.c Eric W. Biederman
2007-01-16 16:39 ` [PATCH 41/59] sysctl: C99 convert ctl_tables in arch/x86_64/mm/init.c Eric W. Biederman
2007-01-16 16:39 ` [PATCH 42/59] sysctl: Remove sys_sysctl support from the hpet timer driver Eric W. Biederman
2007-01-17  7:54   ` Clemens Ladisch
2007-01-16 16:39 ` [PATCH 43/59] sysctl: Remove sys_sysctl support from drivers/char/rtc.c Eric W. Biederman
2007-01-16 16:39 ` [PATCH 44/59] sysctl: Register the sysctl number used by the arlan driver Eric W. Biederman
2007-01-16 16:39 ` [PATCH 45/59] sysctl: C99 convert ctl_tables in drivers/parport/procfs.c Eric W. Biederman
2007-01-16 22:15   ` Ingo Oeser
2007-01-16 23:00     ` Eric W. Biederman
2007-01-16 16:39 ` [PATCH 46/59] sysctl: C99 convert coda ctl_tables and remove binary sysctls Eric W. Biederman
2007-01-16 16:39 ` [PATCH 47/59] sysctl: C99 convert ctl_tables in NTFS and remove sys_sysctl support Eric W. Biederman
2007-01-16 16:39 ` [PATCH 48/59] sysctl: Register the ocfs2 sysctl numbers Eric W. Biederman
2007-01-16 20:37   ` Mark Fasheh
2007-01-16 16:39 ` [PATCH 49/59] sysctl: Move init_irq_proc into init/main where it belongs Eric W. Biederman
2007-01-27 10:51   ` Andrew Morton
2007-01-16 16:39 ` [PATCH 50/59] sysctl: Move utsname sysctls to their own file Eric W. Biederman
2007-01-17 17:41   ` Kirill Korotaev
2007-01-17 19:31     ` Eric W. Biederman
2007-01-22 22:24       ` Herbert Poetzl
2007-01-16 16:39 ` [PATCH 51/59] sysctl: Move SYSV IPC " Eric W. Biederman
2007-01-17 17:44   ` Kirill Korotaev
2007-01-16 16:39 ` [PATCH 52/59] sysctl: Create sys/fs/binfmt_misc as an ordinary sysctl entry Eric W. Biederman
2007-01-16 16:39 ` [PATCH 53/59] sysctl: Remove support for CTL_ANY Eric W. Biederman
2007-01-16 16:39 ` [PATCH 54/59] sysctl: Remove support for directory strategy routines Eric W. Biederman
2007-01-16 16:40 ` [PATCH 55/59] sysctl: Remove insert_at_head from register_sysctl Eric W. Biederman
2007-01-16 16:40 ` [PATCH 56/59] sysctl: factor out sysctl_head_next from do_sysctl Eric W. Biederman
2007-01-16 16:40 ` [PATCH 57/59] sysctl: allow sysctl_perm to be called from outside of sysctl.c Eric W. Biederman
2007-01-16 16:40 ` [PATCH 58/59] sysctl: Reimplement the sysctl proc support Eric W. Biederman
2007-03-14 10:38   ` Ingo Molnar
2007-03-14 10:48     ` Alexey Dobriyan
2007-03-14 12:24       ` Ingo Molnar
2007-03-14 13:34         ` Eric W. Biederman
2007-03-14 13:46           ` Ingo Molnar
2007-03-14 15:44         ` Michal Schmidt
2007-01-16 16:40 ` [PATCH 59/59] sysctl: Remove the proc_dir_entry member for the sysctl tables Eric W. Biederman
2007-01-16 16:53 ` [PATCH 0/59] Cleanup sysctl H. Peter Anvin
2007-01-16 18:12   ` Eric W. Biederman
2007-01-16 18:35     ` H. Peter Anvin
2007-01-16 18:54       ` Eric W. Biederman
2007-01-16 18:58         ` H. Peter Anvin
2007-01-16 19:03           ` Eric W. Biederman
2007-01-16 19:15             ` H. Peter Anvin
2007-01-16 19:30               ` Eric W. Biederman
2007-01-16 20:02 ` David Howells
2007-01-17  4:21 ` Andi Kleen
2007-01-17 12:10 ` Martin Schwidefsky
2007-01-17 18:10 ` Kirill Korotaev
2007-01-17 19:02   ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11689656574092-git-send-email-ebiederm@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=a.zummo@towertech.it \
    --cc=aharkes@cs.cmu.edu \
    --cc=aia21@cantab.net \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=clemens@ladisch.de \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@TELEMANN.coda.cs.cmu.edu \
    --cc=containers@lists.osdl.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kurt.hackel@oracle.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-390@vm.marist.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=linux-parport@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxsh-shmedia-dev@lists.sourceforge.net \
    --cc=mark.fasheh@oracle.com \
    --cc=minyard@acm.org \
    --cc=netdev@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=paulus@samba.org \
    --cc=philb@gnu.org \
    --cc=ralf@linux-mips.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=tim@cyberelk.net \
    --cc=tony.luck@intel.com \
    --cc=vojtech@suse.cz \
    --cc=xfs-masters@oss.sgi.com \
    --cc=xfs@oss.sgi.com \
    --subject='Re: [PATCH 32/59] sysctl: C99 convert arch/mips/lasat/sysctl.c and remove ABI breakage.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).