From owner-cvs-all Wed Sep 11 10: 9:16 2002 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 22FCD37B401 for ; Wed, 11 Sep 2002 10:09:07 -0700 (PDT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1755F43E65 for ; Wed, 11 Sep 2002 10:09:06 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 20763 invoked from network); 11 Sep 2002 17:09:04 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail13.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 11 Sep 2002 17:09:04 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.5/8.12.5) with ESMTP id g8BH93Bv035497; Wed, 11 Sep 2002 13:09:03 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200209110410.g8B4Aggt079926@freefall.freebsd.org> Date: Wed, 11 Sep 2002 13:09:04 -0400 (EDT) From: John Baldwin To: "Andrew R. Reiter" Subject: RE: cvs commit: src/sys/kern kern_acct.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 11-Sep-2002 Andrew R. Reiter wrote: > arr 2002/09/10 21:10:41 PDT > > Modified files: > sys/kern kern_acct.c > Log: > - Lock down the accounting code globals with a subsystem mutex. > > Reviewed by: jhb, mdodd Erm, well, I reviewed an earlier version and had some comments. :) More comments: @@ -323,12 +340,15 @@ { struct statfs sb; + mtx_lock(&acct_mtx); + if (savacctp != NULLVP) { if (savacctp->v_type == VBAD) { (void) vn_close(savacctp, savacctflags, savacctcred, NULL); savacctp = NULLVP; savacctcred = NOCRED; + mtx_unlock(&acct_mtx); return; } (void)VFS_STATFS(savacctp->v_mount, &sb, (struct thread *)0); This should probably be changed at the end after the second 'if' to save savacctp and savacctcred in temp vars, clear the two variables, then drop the lock. Then do a vn_close() with the temp variables. You should probably also drop the lock while you do VFS_STATFS. vref() the vnode before dropping, then after VFS_STATFS() you can get the lock again and compare the vp saved in a temp variable to savacctp and just vrele() the temp vp if they don't match, otherwise proceed with the current code. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message