From owner-p4-projects@FreeBSD.ORG Wed Feb 23 17:37:18 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 31CCB16A4D0; Wed, 23 Feb 2005 17:37:18 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E92B16A4CE for ; Wed, 23 Feb 2005 17:37:17 +0000 (GMT) Received: from mail23.sea5.speakeasy.net (mail23.sea5.speakeasy.net [69.17.117.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E66A43D2D for ; Wed, 23 Feb 2005 17:37:17 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 6337 invoked from network); 23 Feb 2005 17:37:17 -0000 Received: from server.baldwin.cx ([216.27.160.63]) (envelope-sender )AES256-SHA encrypted SMTP for ; 23 Feb 2005 17:37:16 -0000 Received: from [10.50.40.202] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id j1NHat4J023967; Wed, 23 Feb 2005 12:37:12 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Robert Watson Date: Wed, 23 Feb 2005 12:38:02 -0500 User-Agent: KMail/1.6.2 References: <200502231158.j1NBwljD042625@repoman.freebsd.org> In-Reply-To: <200502231158.j1NBwljD042625@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200502231238.02637.jhb@FreeBSD.org> X-Spam-Status: No, score=-102.8 required=4.2 tests=ALL_TRUSTED, USER_IN_WHITELIST autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx cc: Perforce Change Reviews Subject: Re: PERFORCE change 71656 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2005 17:37:18 -0000 On Wednesday 23 February 2005 06:58 am, Robert Watson wrote: > http://perforce.freebsd.org/chv.cgi?CH=71656 > > Change 71656 by rwatson@rwatson_paprika on 2005/02/23 11:58:23 > > If oldp is set, sysctl returns the value of a MIB entry before > modification, rather than after. This is kind of wrong. I tried to explain to Tom what should be done but he didn't really get it. The correct order of operations should be this: SYSCTL_IN(&newrule); lock(); oldrule = ...; update(&newrule); unlock(); SYSCTL_OUT(&oldrule); That is, the point is to do the entire read old and write new bit in a single locked section. This more closely matches how most system calls work where they copyin() the arguments, perform actions, then copyout() the results. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org