From owner-svn-src-head@FreeBSD.ORG Tue Dec 30 22:41:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1792F8A0; Tue, 30 Dec 2014 22:41:54 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC01C1518; Tue, 30 Dec 2014 22:41:53 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id k14so3471700wgh.30; Tue, 30 Dec 2014 14:41:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=kj6WXzEf3nFFY0nIeZilQzFKIRTLNPqMmhCWOZjnaTs=; b=LIs91Phhci00wA6mcy71gKpZsTfK5GPpUvBskC5nKtyH1Q3XpHTOv2emHi4vbZPX8q w3YAwnDrhYkHeDRW4mqdIOEJjmkj1EQnJ94DksiBqARGxW6SC4Ozn1eTLtjEwQ/zSc/5 tCFkdYyY6RWoSsFiQWv0slebSR1fMNGQODwdQLTfJE1gR+bXXSeMC14Fl4wxxmnSr22P exBdjPiUgC2lw0aK4USTYGWxTiA0ufkD3BzickAhmLJQbPZ5AhFR04m19kiQjnY1SexS qW+LzIO9mLG+oWGTWx1gDxl9NW4rRPr97x/eVBlNIdFLJOBEmwgpzommuPCCUJF7FRa6 XRmw== X-Received: by 10.180.205.163 with SMTP id lh3mr111715921wic.63.1419979311637; Tue, 30 Dec 2014 14:41:51 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id fp2sm42438771wib.8.2014.12.30.14.41.50 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Dec 2014 14:41:50 -0800 (PST) Date: Tue, 30 Dec 2014 23:41:48 +0100 From: Mateusz Guzik To: Gleb Smirnoff Subject: Re: svn commit: r276341 - head/sys/kern Message-ID: <20141230224148.GB27329@dft-labs.eu> References: <201412281924.sBSJO284028980@svn.freebsd.org> <20141230200601.GF15484@FreeBSD.org> <20141230202226.GA27329@dft-labs.eu> <20141230221243.GH15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20141230221243.GH15484@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 22:41:54 -0000 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