From owner-cvs-all@FreeBSD.ORG Thu May 29 14:52:53 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0910A37B401; Thu, 29 May 2003 14:52:53 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E15543FD7; Thu, 29 May 2003 14:52:52 -0700 (PDT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 584872ED52E; Thu, 29 May 2003 14:52:52 -0700 (PDT) Date: Thu, 29 May 2003 23:52:52 +0200 From: Maxime Henrion To: Nate Lawson Message-ID: <20030529215252.GF21011@elvis.mu.org> References: <20030529211927.3EF8237B4C4@hub.freebsd.org> <20030529144231.A10415@root.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030529144231.A10415@root.org> User-Agent: Mutt/1.4.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_sysctl.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2003 21:52:53 -0000 Nate Lawson wrote: > On Thu, 29 May 2003, Maxime Henrion wrote: > > Modified files: > > sys/kern kern_sysctl.c > > Log: > > When loading a module that contains a sysctl which is already compiled > > in the kernel, the sysctl_register() call would fail, as expected. > > However, when unloading this module again, the kernel would then panic > > in sysctl_unregister(). Print a message error instead. > > > > + /* > > + * This can happen when a module fails to register and is > > + * being unloaded afterwards. It should not be a panic() > > + * for normal use. > > + */ > > + if (error) > > + printf("%s: failed to unregister sysctl\n", __func__); > > Thank you, this is helpful. However, we have quite a few error messages > that appear when an attach fails. Is this one necessary in practice or > should the eventual plan be to change the API to return an errno? (Note, > not talking about 5.1 here). I agree with you that we should think about this issue a bit more once 5.1 is out, as I'm not comfortable with this error message. However, if I remember right, changing the API is not an option after 5.1 since we promised to not break APIs and ABIs past this release. If the message turns out to be annoying, it can be removed a bit later and we can have sysctl_unregister() silently fail. Changing the API would probably be better, but I bet we'll have to do this for 6.0. Cheers, Maxime