Re: modules registering as sysctl handlers

Muli Ben-Yehuda
2004-03-04T10:38:46Z

[-- Attachment #1: Type: text/plain, Size: 2240 bytes --]

On Wed, Mar 03, 2004 at 10:43:32AM +0000, viro@parcelfarce.linux.theplanet.co.uk wrote:

> At least parport has both module-wide and per-port sysctls. The
> latter are dynamic even if module support is turned off. I seriously
> suspect that other examples are similar.

For reference, here's the list of register_sysctl_table() users from
2.6.3-bk with an "almost allmodconfig" configuration. Those that I've
randomly looked at all used a statically allocated ctl_table
structure. Will adding a .owner field to it with the relevant
module_get/module_put in the registration functions hinder future
efforts to fix it properly? It won't be perfect, but it will be better
than what we currently have.

./drivers/cdrom/cdrom.ko uses register_sysctl
./drivers/char/rtc.ko uses register_sysctl
./drivers/cpufreq/cpufreq_userspace.ko uses register_sysctl
./drivers/md/md.ko uses register_sysctl
./drivers/net/wireless/arlan.ko uses register_sysctl
./drivers/parport/parport.ko uses register_sysctl
./drivers/scsi/scsi_mod.ko uses register_sysctl
./fs/coda/coda.ko uses register_sysctl
./fs/lockd/lockd.ko uses register_sysctl
./fs/ntfs/ntfs.ko uses register_sysctl
./fs/xfs/xfs.ko uses register_sysctl
./net/appletalk/appletalk.ko uses register_sysctl
./net/ax25/ax25.ko uses register_sysctl
./net/bridge/bridge.ko uses register_sysctl
./net/decnet/decnet.ko uses register_sysctl
./net/ipv4/ipvs/ip_vs_lblc.ko uses register_sysctl
./net/ipv4/ipvs/ip_vs_lblcr.ko uses register_sysctl
./net/ipv4/ipvs/ip_vs.ko uses register_sysctl
./net/ipv4/netfilter/ip_conntrack.ko uses register_sysctl
./net/ipv4/netfilter/ip_queue.ko uses register_sysctl
./net/ipv6/netfilter/ip6_queue.ko uses register_sysctl
./net/ipv6/ipv6.ko uses register_sysctl
./net/ipx/ipx.ko uses register_sysctl
./net/irda/irda.ko uses register_sysctl
./net/netrom/netrom.ko uses register_sysctl
./net/rose/rose.ko uses register_sysctl
./net/rxrpc/rxrpc.ko uses register_sysctl
./net/sctp/sctp.ko uses register_sysctl
./net/sunrpc/sunrpc.ko uses register_sysctl
./net/unix/unix.ko uses register_sysctl
./net/x25/x25.ko uses register_sysctl

Cheers,
Muli
--
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]