tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

sysctl's in modules - specifically compat_netbsd32

While tracking down some strange-looking entries in dmesg (as mentioned on current-users) it occurs to me that the current sysctl architecture doesn't lend itself well to having loadable modules declaring new sysctl entries with CTLFLAG_PERMANENT set. Of particular interest is module compat_netbsd32 which has its own netbsd32_sysctl_init() routine.

This routine is called long after the main sysctl_init() has finished and marked the tree as having been set-up (set CTLFLAG_PERMANENT on the root node). Yet this routine attempts to create several PERMANENT nodes. These attempts all fail, generating the strange-looking dmesg, but the nodes they attempt to create are apparently created elsewhere, so there's no real damage.

For the specific case, it would seem that netbsd32_sysctl_init() is superfluous and unnecessary. But there might be other modules that want to create entries, and those will fail if the entries being created are marked PERMANENT. Since modules can be unloaded, it seems to me that modules' sysctl()s should not be marked PERMANENT.


|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | |

Home | Main Index | Thread Index | Old Index