svn commit: r276341 - head/sys/kern

Mateusz Guzik mjguzik at gmail.com
Tue Dec 30 22:41:54 UTC 2014


On Wed, Dec 31, 2014 at 01:12:43AM +0300, Gleb Smirnoff wrote:
> On Tue, Dec 30, 2014 at 09:22:27PM +0100, Mateusz Guzik wrote:
> M> On Tue, Dec 30, 2014 at 11:06:01PM +0300, Gleb Smirnoff wrote:
> M> > On Sun, Dec 28, 2014 at 07:24:02PM +0000, Mateusz Guzik wrote:
> M> > M> Author: mjg
> M> > M> Date: Sun Dec 28 19:24:01 2014
> M> > M> New Revision: 276341
> M> > M> URL: https://svnweb.freebsd.org/changeset/base/276341
> M> > M> 
> M> > M> Log:
> M> > M>   sysctl: don't modify oid_running for static nodes
> M> > M>   
> M> > M>   It is necessary to prevent nodes from being destroyed while used, but static
> M> > M>   ones cannot be destroyed.
> M> > 
> M> > What about nodes that go away on kernel module unload? Not sure
> M> > they were protected properly before your commit, though :)
> M> > 
> M> 
> M> They are not static.
> 
> I don't see how they can get CTLFLAG_DYN. Look for any (un)loadable
> modules as an example, e.g. aio(4) implemented in vfs_aio.c. How its
> sysctls get CTLFLAG_DYN?
> 

Bugger.

Turns out indeed one can sysctl_register_oid and then it does not have
the flag. What's more, one can unregister it in similar way which
completely ignores oid_running anyway.

As such, yes, there is a bug but my changes don't affect it.

Maybe I'll try to fix it later with a proven hack (a macro which expands
to 0 at kernel compile time and to _DYN during module build).

-- 
Mateusz Guzik <mjguzik gmail.com>


More information about the svn-src-head mailing list