From owner-p4-projects@FreeBSD.ORG Wed Feb 23 19:42:08 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4A01B16A4D0; Wed, 23 Feb 2005 19:42:08 +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 0416E16A4CE; Wed, 23 Feb 2005 19:42:08 +0000 (GMT) Received: from pittgoth.com (14.zlnp1.xdsl.nauticom.net [209.195.149.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87F0943D1F; Wed, 23 Feb 2005 19:42:07 +0000 (GMT) (envelope-from trhodes@FreeBSD.org) Received: from mobile.pittgoth.com (ip68-230-188-82.dc.dc.cox.net [68.230.188.82]) (authenticated bits=0) by pittgoth.com (8.12.10/8.12.10) with ESMTP id j1NJg6Kw051057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 23 Feb 2005 14:42:06 -0500 (EST) (envelope-from trhodes@FreeBSD.org) Date: Wed, 23 Feb 2005 14:41:59 -0500 From: Tom Rhodes To: John Baldwin Message-ID: <20050223144159.45fa8705@mobile.pittgoth.com> In-Reply-To: <200502231238.02637.jhb@FreeBSD.org> References: <200502231158.j1NBwljD042625@repoman.freebsd.org> <200502231238.02637.jhb@FreeBSD.org> X-Mailer: Sylpheed-Claws 1.0.0 (GTK+ 1.2.10; i386-portbld-freebsd6.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: Perforce Change Reviews cc: Robert Watson 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 19:42:09 -0000 On Wed, 23 Feb 2005 12:38:02 -0500 John Baldwin wrote: > 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. You're right, from the previous email I didn't really get what you were trying to say. My bad. -- Tom Rhodes